Possible for Uber to add car count to /v1/products - uber-api

I know Uber doesn't want to allow car coordinates for all available cars (not fully certain why though), however, could Uber please at least add the total available cars at any given request time, something like the following:
"products": [
{
"capacity": 2,
**"available": 7,** // add available cars available (or similar)
"description": "Ride for less with uberPOOL",
"price_details": {
"distance_unit": "mile",
"cost_per_minute": 0.26,
"service_fees": [
{
"fee": 1.0,
"name": "Safe Rides Fee"
}
],
"minimum": 5.0,
"cost_per_distance": 1.3,
"base": 2.2,
"cancellation_fee": 5.0,
"currency_code": "USD"
},
"image": "http://d1a3f4spazzrp4.cloudfront.net/car.jpg",
"display_name": "POOL",
"product_id": "26546650-e557-4a7b-86e7-6a3942445247",
"shared": true,
},
Showing that a car is available is great, but what if its only one car and someone else snags it before the user viewing it is able to do so? If it shows "Cars Available: 5" - then the user knows there is a pretty good chance they will get a driver close to the allotted ETA already provided.

Related

TemperatureSetting "What's the temperature in my living room ?" sometimes answers weird stuff

I recently released a Smart Home action for interacting with our thermostats. This device type is Thermostat and the single implemented trait is TemperatureSetting.
When I ask my home assistant "What's the temperature in the living room ?", sometimes it answers good, sometimes it answers "Ok, this device has been updated" (this is a translation from my language so it may not be the accurate answer).
Checking the logs on my server, I can see the QUERY intent responses being made.
The following QUERY response provokes a "The temperature in your living room is 20.5 degrees" answer:
{
"aa0c2504f896": {
"status": "SUCCESS",
"online": true,
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.7,
"thermostatTemperatureSetpoint": 20.5
}
}
This one provokes "Ok, this device has been updated" :
{
"aa0c2504f896": {
"status": "SUCCESS",
"online": true,
"thermostatMode": "heat",
"thermostatTemperatureAmbient": 20.7,
"thermostatTemperatureSetpoint": 19.5
}
}
I can reproduce it by changing the setpoint 1° lower, as shown by the previous logs. When doing so, the EXECUTE intent sends a ReportState request, so the HomeGraph API is updated synchronously.
Am I doing something wrong ?
Edit:
It happens every time the setpoint and the ambient temperature are different (in a 0.5 degrees interval). The Google Home UI always renders it correctly, it is the voice control that answers something wrong.
Here is also my SYNC payload :
{
"requestId": "5878230358273544341",
"payload": {
"agentUserId": "3101066d-b012-4780-8d77-7297aaea4e37",
"devices": [
{
"id": "aa0c2504f896",
"type": "action.devices.types.THERMOSTAT",
"traits": [
"action.devices.traits.TemperatureSetting"
],
"name": {
"defaultNames": [
"Thermostat COMAP"
],
"name": "Thermostat salon"
},
"willReportState": true,
"attributes": {
"availableThermostatModes": [
"heat",
"on"
],
"thermostatTemperatureRange": {
"minThresholdCelsius": 4,
"maxThresholdCelsius": 30
},
"thermostatTemperatureUnit": "C"
},
"deviceInfo": {
"manufacturer": "COMAP",
"model": "Thermostat",
"swVersion": "1143"
}
}
]
}
}
The query and sync payload provided by you looks good. We have updated the thermostat implementation throughout the last year and it works much better with floating points. If this issue still persists, I recommend creating a ticket on the public issue tracker.
There can also be one more reason as to why you have been encountering this issue. It might be also due to the local language, there can be a possibility that the Google Assistant hasn’t still incorporated the full compatibility for this particular language. Our NLU team is constantly working on incorporating these language capabilities into the system.

Documentation on HERE api responses

I am using the Routing API v8 to get instructions on how to get from one point to the other. I want to provide the user with a time and distance estimate.
Still trying to figure out how to get the distance, but for the time, I have been adding the "duration" fields but the result is very different from what I experience in that route. Additionally, there are also other fields in the response that I am not very sure about their meaning. For example, in the below response:
...
"actions": [
{
"action": "depart",
"duration": 133,
"instruction": "Head northwest on Flint Close. Go for 124 m.",
"offset": 0
},
{
"action": "turn",
"duration": 168,
"instruction": "Turn right onto Vicarage Lane. Go for 158 m.",
"offset": 3,
"direction": "right",
"severity": "quite"
},
{
"action": "turn",
"duration": 234,
"instruction": "Turn left onto Deanery Road. Go for 233 m.",
"offset": 9,
"direction": "left",
"severity": "quite"
},
...
What does the offset property mean? Is there somewhere where I can find more information on these?
Regarding to the properties, you can find them in the OpenAPI specifition document here
E.g., for "offset", it is a property for a few actions (like TurnAction in the spec),
offset:
description: Offset of a coordinate in the section's polyline.
type: integer
Regarding to distance, it should be in the summary section.
For a route which duration is not expected, we will need a deeper analysis. Please provide the exact API call you used in the comment, and we can run a check on that.
Also, please feel free to try our refclient here for a quick feeling of our Routing APIs and varies parameters.

identify new words as intents in rasa nlu

Have been using rasa nlu to classify intents and entities for my chatbot. Everything works as expected (with extensive training) but with entities, it seems to predict the value based on the exact position and length of the word. This is fine for a scenario where the entities are limited. But when the bot needs to identify a word (which has a different length and not trained yet, for example a new name), it's failing to detect. Is there a way wherein I can make rasa identify the entities based on the relative position of the word or better yet, insert a list of words that becomes the domain specific for the entity to find a match with (like phrase list in LUIS)?
{"q":"i want to buy a Casio SX56"}
{
"project": "default",
"entities": [
{
"extractor": "ner_crf",
"confidence": 0.7043648832678735,
"end": 26,
"value": "Casio SX56",
"entity": "watch",
"start": 16
}
],
"intent": {
"confidence": 0.8835646513829762,
"name": "buy_watch"
},
"text": "i want to buy a Casio SX56",
"model": "model_20180522-165141",
"intent_ranking": [
{
"confidence": 0.8835646513829762,
"name": "buy_watch"
},
{
"confidence": 0.07072182459497935,
"name": "greet"
}
]
}
But if Casio SX56 gets replaced with Citizen M1:
{"q":"i want to buy a Citizen M1"}
{
"project": "default",
"intent": {
"confidence": 0.8710909096729019,
"name": "buy_watch"
},
"text": "i want to buy a Citizen M1",
"model": "model_20180522-165141",
"intent_ranking": [
{
"confidence": 0.8710909096729019,
"name": "buy_watch"
},
{
"confidence": 0.07355588750895545,
"name": "greet"
}
]
}
Thank you!
Make sure you actually added each entity value training examples before training it with rasa_nlu.
--- For successful entity extraction we need to create at least 2 or more contextual training data ---
add this eg. in rasa_nlu training data if it's not extracting properly
"text": "i want to buy a Citizen M1",
"model": "model_20180522-165141",
"intent_ranking": [
{
"confidence": 0.8710909096729019,
"name": "buy_watch"
},
{
"confidence": 0.07355588750895545,
"name": "greet"
}
]
entity extraction with phrase matching does work in rasa_nlu try it with spacy_sklearn backend pipeline
The feature I was looking for is phrase matcher which would allow me to add a list of possible entities to the training model. This way, if any new name pops up, we can simply add the name to the phrase list and the model would be able to identify it with all possible utterances. Though this is still in development and should be added to the master soon: https://github.com/RasaHQ/rasa_nlu/pull/822

Why do I get two UberPool products in the APIs?

I get two UberPool products in the following APIs:
api.uber.com/v1/estimates/time
api.uber.com/v1/estimates/price
api.uber.com/v1/products
Why do I get two products? How are they different?
Example response:
Url:
api.uber.com/v1/estimates/price
Response:
{
"prices": [
{
"localized_display_name": "uberPOOL",
"high_estimate": 33,
"minimum": null,
"duration": 0,
"estimate": "₹32.50",
"distance": 0,
"display_name": "uberPOOL",
"product_id": "e0178e76-b13f-4ae6-9f72-6acadbb450c5",
"low_estimate": 32,
"surge_multiplier": 1,
"currency_code": "INR"
},
{
"localized_display_name": "uberPOOL",
"high_estimate": 51,
"minimum": null,
"duration": 0,
"estimate": "Unavailable",
"distance": 0,
"display_name": "uberPOOL",
"product_id": "f855a84b-a0ec-40d8-a455-fb0d2db58089",
"low_estimate": 50,
"surge_multiplier": 1,
"currency_code": "INR"
},
{
"localized_display_name": "uberGO",
"high_estimate": 50,
"minimum": 50,
"duration": 0,
"estimate": "₹50",
"distance": 0,
"display_name": "uberGO",
"product_id": "18ba4578-b11b-49a6-a992-a132f540b027",
"low_estimate": 50,
"surge_multiplier": 1,
"currency_code": "INR"
}
....
]
}
Thank you for the report. This is a known issue and we're working on a fix. In the meantime, you can use either uberPOOL product that is surfaced.
TL;DR Uber sometimes offers many products in a given location, and they're all returned from those two endpoints.
To expound on that... according to the docs, this is normal:
The Products endpoint returns information about the Uber products
offered at a given location. The response includes the display name
and other details about each product, and lists the products in the
proper display order.
Some products, such as uberEATS, are not returned by this endpoint.
We'll soon be making uberPOOL available in this endpoint.
Particularly: We'll soon be making uberPOOL available in this endpoint. It seems that time has come.
The same goes for the estimates endpoint.
The Price Estimates endpoint returns an estimated price range for each
product offered at a given location.
How are they different?
Uber offers different types of services in different countries.
UberGo is a cheaper version of UberX that seems to be specific to India.
UberPool is fairly straight forward in that it's a carpooling service offered to those who wish to split the fare with others that are heading in the same destination.
Since services vary by location, it's best to research them individually when constructing a service that's consuming the Uber API.

How to get purchase_url from API

I added a buy link to one of my tracks and then tried to access it via API (Ruby wrapper). It displays always empty field.
Updating purchase_url is also not working, while other fields get updated.
Is this a bug or something wrong done on my side?
Can you post your URL? I'm able to retrieve this info fine from a REST console with a standard GET request.
Using this URL as an example:
https://soundcloud.com/maddecent/grandtheft-mobbin-feat
HTTP GET: https://api.soundcloud.com/resolve.json?url=https://soundcloud.com/maddecent/grandtheft-mobbin-feat&client_id=[client_id]
Returns:
{
"status": "302 - Found",
"location": "https://api.soundcloud.com/tracks/107686148.json?client_id=[client_id]"
}
Hitting the track endpoint:
HTTP GET: https://api.soundcloud.com/tracks/107686148.json?client_id=[client_id]
Returns:
{
"kind": "track",
"id": 107686148,
"created_at": "2013/08/28 17:24:39 +0000",
"user_id": 14730,
"duration": 186766,
"commentable": true,
"state": "finished",
"original_content_size": 9678964,
"last_modified": "2014/12/30 20:37:07 +0000",
"sharing": "public",
"tag_list": "Hedspin \"Mad Decent\" Jeffree's Dance Electronic Club Mobbin",
"permalink": "grandtheft-mobbin-feat",
"streamable": true,
"embeddable_by": "all",
"downloadable": false,
"purchase_url": "http://smarturl.it/GrandtheftMOB",
"label_id": null,
"purchase_title": "Buy on iTunes",
"genre": "",
"title": "Grandtheft - Mobbin feat. Hedspin",
"description": "Buy on iTunes: http://smarturl.it/GrandtheftMOB\r\nBuy on Beatport: http://bit.ly/GrandtheftBP\r\nBuy on Amazon: http://amzn.com/B00F4IFFQM\r\n\r\nRespected as one of the best live Canadian DJs in the game, Grandtheft has taken a break from globetrotting to pack in a HUGE release for Jeffree’s. Along with World Red Bull Thre3style champ and close pal Hedspin, they have made something minimal but fierce with their track “Mobbin.” The build channels the darkness of No Limit Records at its prime while the drop carries the bounce of a screwed and chopped new jack swing track. That, combined with the most menacing synth stab we’ve heard in a while, makes this tune unstoppable.\r\n\r\nWith “Give Me More,” Grandtheft lends us a soulful track that marries a delicious combination trap and dub in the same vein as his popular remix of Keys N Krates’ song “Treat Me Right” released off of Dim Mak. The juxtaposition of the drop is a total WTF moment for any club-goer and we mean that in the best way possible. Grandtheft’s momentum continues to pick up incredible speed with each release, and we don’t see his rise mellowing out anytime soon.\r\n\r\nGrandtheft\r\nSoundcloud: http://www.soundcloud.com/grandtheft\r\nFacebook: http://facebook.com/grandtheftmusic\r\nTwitter: https://twitter.com/grandtheft\r\nInstagram: http://instagram.com/itsgrandtheft\r\nYoutube: http://youtube.com/grandtheftofficial\r\n\r\nHedspin\r\nSoundcloud: https://soundcloud.com/hedspin\r\nFacebook: https://www.facebook.com/djhedspin\r\nTwitter: https://twitter.com/HEDSPIN\r\nInstagram: http://instagram.com/djhedspin",
"label_name": "Jeffree's",
"release": "JEFF060",
"track_type": "",
"key_signature": "",
"isrc": "US-Z4V-13-00221",
"video_url": null,
"bpm": null,
"release_year": 2013,
"release_month": 9,
"release_day": 17,
"original_format": "mp3",
"license": "all-rights-reserved",
"uri": "https://api.soundcloud.com/tracks/107686148",
"user": {
"id": 14730,
"kind": "user",
"permalink": "maddecent",
"username": "Mad Decent",
"last_modified": "2014/12/18 18:12:40 +0000",
"uri": "https://api.soundcloud.com/users/14730",
"permalink_url": "http://soundcloud.com/maddecent",
"avatar_url": "https://i1.sndcdn.com/avatars-000112599114-5etg3g-large.jpg"
},
"permalink_url": "http://soundcloud.com/maddecent/grandtheft-mobbin-feat",
"artwork_url": "https://i1.sndcdn.com/artworks-000056426845-b40tmr-large.jpg",
"waveform_url": "https://w1.sndcdn.com/JL8flUq6Vn0x_m.png",
"stream_url": "https://api.soundcloud.com/tracks/107686148/stream",
"playback_count": 770622,
"download_count": 16462,
"favoritings_count": 16626,
"comment_count": 489,
"attachments_uri": "https://api.soundcloud.com/tracks/107686148/attachments",
"policy": "MONETIZE"
}
Purchase info is in the JSON response:
"purchase_url": "http://smarturl.it/GrandtheftMOB",
"purchase_title": "Buy on iTunes",