DevEmperor / WristAssist

A powerful ChatGPT and DALL-E app for all WearOS devices
https://play.google.com/store/apps/details?id=net.devemperor.wristassist
Apache License 2.0
93 stars 14 forks source link

Can GPS integration be added? #9

Open BryanLDC opened 10 months ago

BryanLDC commented 10 months ago

As something very far in the future, it is possible to add a feature to, for example, take the GPS coordinates of the smartwtch and create an interface that communicates, for example, with the OpenStreetMap API and process the output for questions such as: "What restaurants are close to where I am?"

DevEmperor commented 10 months ago

Unfortunately, this is not possible. Since I do not know before a prompt whether GPS coordinates are needed, I would have to have them fetched for every question, which would require permanent location permission. I consider this excessive and is certainly not desired by most users. In addition, I would have to establish a connection to OpenStreetMap, whereby GPT does not even know when it should use this connection. The feature is more like another AI, whereas I just want to create a user interface for the previous models of OpenAI.

BryanLDC commented 10 months ago

I understand, maybe what I had in mind was something more or less similar to this; WristAssist comes with a predefined role, let's call it "Tourist Guide", when activating this role, each request made to openai, a request will be previously made to some map API service, in this example OpenStreetMap (You will only be asked for permissions location to the user when activating the "Tourist Guide" role): Example request: https://api.openstreetmap.org/api/0.6/map?bbox=-80.196856,25.756608,-80.186856,25.766607999999998

In the query request, something like:

  <node id="4235821639" visible="true" version="2" changeset="70497556" timestamp="2019-05-22T02:44:19Z" user="LeifRasmussen" uid="4312767" lat="25.7611532" lon="-80.1915783">
   <tag k="amenity" v="restaurant"/>
   <tag k="brand" v="Vapiano"/>
   <tag k="brand:wikidata" v="Q506252"/>
   <tag k="brand:wikipedia" v="en:Vapiano"/>
   <tag k="cuisine" v="italian"/>
   <tag k="name" v="Vapiano"/>
  </node>
  <node id="4235831895" visible="true" version="3" changeset="79225133" timestamp="2020-01-05T22:42:06Z" user="MapMan45" uid="10557475" lat="25.7619442" lon="-80.1914768">
   <tag k="amenity" v="pharmacy"/>
   <tag k="brand" v="CVS Pharmacy"/>
   <tag k="brand:wikidata" v="Q2078880"/>
   <tag k="brand:wikipedia" v="en:CVS Pharmacy"/>
   <tag k="healthcare" v="pharmacy"/>
   <tag k="name" v="CVS Pharmacy"/>
   <tag k="opening_hours" v="24/7"/>
   <tag k="short_name" v="CVS"/>
  </node>

And then this result will be concatenated to the chatgpt request, example:

If the user writes: "What restaurants are near my location?" It is sent to gpt:

What restaurants are near my location?

Current coordinates: 25.761608, -80.191856
Sites close to the location are:
   <node id="4235821639" visible="true" version="2" changeset="70497556" timestamp="2019-05-22T02:44:19Z" user="LeifRasmussen" uid="4312767" lat="25.7611532" lon="-80.1915783">
    <tag k="amenity" v="restaurant"/>
    <tag k="brand" v="Vapiano"/>
    <tag k="brand:wikidata" v="Q506252"/>
    <tag k="brand:wikipedia" v="en:Vapiano"/>
    <tag k="cuisine" v="italian"/>
    <tag k="name" v="Vapiano"/>
   </node>
   <node id="4235831895" visible="true" version="3" changeset="79225133" timestamp="2020-01-05T22:42:06Z" user="MapMan45" uid="10557475" lat="25.7619442" lon="-80.1914768">
    <tag k="amenity" v="pharmacy"/>
    <tag k="brand" v="CVS Pharmacy"/>
    <tag k="brand:wikidata" v="Q2078880"/>
    <tag k="brand:wikipedia" v="en:CVS Pharmacy"/>
    <tag k="healthcare" v="pharmacy"/>
    <tag k="name" v="CVS Pharmacy"/>
    <tag k="opening_hours" v="24/7"/>
    <tag k="short_name" v="CVS"/>
   </node>

Result returned by chatgpt (I tested from the playground):

Based on the information provided, there is a Vapiano restaurant near your location. Here are the details:

- Name: Vapiano
- Cuisine: Italian
- Brand: Vapiano
- Coordinates: 25.7611532, -80.1915783

Please note that this is just one restaurant near your location. There may be other restaurants nearby as well.

Maybe I only mention it as an idea, thank you very much for reading it!

DevEmperor commented 10 months ago

Okay, that sounds plausible. The idea of doing this as a seperate, predefined chat is interesting. I'll put that on the to-do list. Thanks for the idea. :)

muehlt commented 10 months ago

Hi! You may want to have a look at Assistants API for this. It's rather simple to add the support client-side and then one could add custom logic for those tools.