talk2map-test / README.md
Noel-Teens's picture
testing new workflow
bfa95ad
|
Raw History Blame Contribute Delete
7.24 kB
metadata
title: Talk2map
emoji: πŸƒ
colorFrom: yellow
colorTo: indigo
sdk: docker
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Talk2Map πŸ—ΊοΈπŸ€–

Talk2Map is a conversational microservice that lets you ask about places naturally. It returns location details, coordinates, bounding box, and maintains a conversation history for smooth human-like interactions.


✨ Features

  • Natural language queries (e.g., β€œbest hotel in Chennai”)
  • Returns place details: name, address, latitude & longitude
  • Returns bounding box (square coordinates) of a location/building
  • Maintains conversation history with human/AI messages
  • Provides both structured data + natural agent reply
  • REST API microservice (Python FastAPI / Node Express ready)

πŸ“‘ API Usage

Request

Send your query with conversation history:

{
  "user_input": "best 2 hotel in chennai",
  "conversation_history": [
    {
      "human": "hello",
      "ai": "hello sir"
    }
  ]
}

Response

Talk2Map replies with both natural text and updated conversation history:

{
  "agent_reply": "The best hotel I found in Chennai is Taj Coromandel, located at 37 Mahatma Gandhi Road, Nungambakkam. Its coordinates are latitude 13.061 and longitude 80.251.",
  "conversation_history": [
    {
      "human": "hello",
      "ai": "hello sir"
    },
    {
      "human": "best hotel in Chennai",
      "ai": "The best hotel I found in Chennai is Taj Coromandel, located at 37 Mahatma Gandhi Road, Nungambakkam. Its coordinates are latitude 13.061 and longitude 80.251."
    }
  ]
}

Extended Response with Location Data

Optionally, you can also include location details + bounding box in the response:

{
    "agent_reply": {
        "message": "1. ITC Grand Chola, a Luxury Collection Hotel, Chennai β€” 63, Mount Rd, Little Mount, Guindy, Chennai, Tamil Nadu 600032 (4.7 β˜…, 41868 Reviews, Maps URL)\nlat,lng: 13.010613, 80.2206015\nSW: (13.009167, 80.219515), NE: (13.011865, 80.222213)\n\n2. The Leela Palace Chennai - Seaside Modern Palace Hotel β€” Adyar Sea Face, Leela Palace Rd, MRC Nagar, Raja Annamalai Puram, Chennai, Tamil Nadu 600028 (4.6 β˜…, 15413 Reviews, Maps URL)\nlat,lng: 13.017048, 80.2736566\nSW: (13.016065, 80.271977), NE: (13.018762, 80.274675)",
        "places": [
            {
                "name": "ITC Grand Chola, a Luxury Collection Hotel, Chennai",
                "address": "63, Mount Rd, Little Mount, Guindy, Chennai, Tamil Nadu 600032",
                "latitude": 13.010613,
                "longitude": 80.2206015,
                "bounding_box": {
                    "north_east": {
                        "lat": 13.011865130291502,
                        "lon": 80.2222132802915
                    },
                    "south_west": {
                        "lat": 13.009167169708498,
                        "lon": 80.21951531970849
                    }
                },
                "rating": 4.7,
                "user_rating_count": 41868,
                "maps_url": "https://maps.google.com/?cid=17494736093121177155&g_mp=Cidnb29nbGUubWFwcy5wbGFjZXMudjEuUGxhY2VzLlNlYXJjaFRleHQQABgEIAA"
            },
            {
                "name": "The Leela Palace Chennai - Seaside Modern Palace Hotel",
                "address": "Adyar Sea Face, Leela Palace Rd, MRC Nagar, Raja Annamalai Puram, Chennai, Tamil Nadu 600028",
                "latitude": 13.017048,
                "longitude": 80.2736566,
                "bounding_box": {
                    "north_east": {
                        "lat": 13.018762480291501,
                        "lon": 80.2746746802915
                    },
                    "south_west": {
                        "lat": 13.016064519708497,
                        "lon": 80.27197671970849
                    }
                },
                "rating": 4.6,
                "user_rating_count": 15413,
                "maps_url": "https://maps.google.com/?cid=7374804035710576015&g_mp=Cidnb29nbGUubWFwcy5wbGFjZXMudjEuUGxhY2VzLlNlYXJjaFRleHQQABgEIAA"
            }
        ]
    },
    "conversation_history": [
        {
            "human": "hello",
            "ai": "hello sir"
        },
        {
            "human": "best 2 hotel in chennai",
            "ai": {
                "message": "1. ITC Grand Chola, a Luxury Collection Hotel, Chennai β€” 63, Mount Rd, Little Mount, Guindy, Chennai, Tamil Nadu 600032 (4.7 β˜…, 41868 Reviews, Maps URL)\nlat,lng: 13.010613, 80.2206015\nSW: (13.009167, 80.219515), NE: (13.011865, 80.222213)\n\n2. The Leela Palace Chennai - Seaside Modern Palace Hotel β€” Adyar Sea Face, Leela Palace Rd, MRC Nagar, Raja Annamalai Puram, Chennai, Tamil Nadu 600028 (4.6 β˜…, 15413 Reviews, Maps URL)\nlat,lng: 13.017048, 80.2736566\nSW: (13.016065, 80.271977), NE: (13.018762, 80.274675)",
                "places": [
                    {
                        "name": "ITC Grand Chola, a Luxury Collection Hotel, Chennai",
                        "address": "63, Mount Rd, Little Mount, Guindy, Chennai, Tamil Nadu 600032",
                        "latitude": 13.010613,
                        "longitude": 80.2206015,
                        "bounding_box": {
                            "north_east": {
                                "lat": 13.011865130291502,
                                "lon": 80.2222132802915
                            },
                            "south_west": {
                                "lat": 13.009167169708498,
                                "lon": 80.21951531970849
                            }
                        },
                        "rating": 4.7,
                        "user_rating_count": 41868,
                        "maps_url": "https://maps.google.com/?cid=17494736093121177155&g_mp=Cidnb29nbGUubWFwcy5wbGFjZXMudjEuUGxhY2VzLlNlYXJjaFRleHQQABgEIAA"
                    },
                    {
                        "name": "The Leela Palace Chennai - Seaside Modern Palace Hotel",
                        "address": "Adyar Sea Face, Leela Palace Rd, MRC Nagar, Raja Annamalai Puram, Chennai, Tamil Nadu 600028",
                        "latitude": 13.017048,
                        "longitude": 80.2736566,
                        "bounding_box": {
                            "north_east": {
                                "lat": 13.018762480291501,
                                "lon": 80.2746746802915
                            },
                            "south_west": {
                                "lat": 13.016064519708497,
                                "lon": 80.27197671970849
                            }
                        },
                        "rating": 4.6,
                        "user_rating_count": 15413,
                        "maps_url": "https://maps.google.com/?cid=7374804035710576015&g_mp=Cidnb29nbGUubWFwcy5wbGFjZXMudjEuUGxhY2VzLlNlYXJjaFRleHQQABgEIAA"
                    }
                ]
            }
        }
    ]
}

πŸ›  Tech Stack

  • Python + FastAPI
  • Geocoding APIs (Google Maps)