I have created a workspace and created the intent, entities and dialogs for a conversation service
Where we use the launch tool and "try it out", i can see the watson text response for the question i asked. But however when i use the api command via a rest client, it does not return the text output.
The input i used for the api was
{
"input": {
"text": "increase the temperature of ac"
}
}
and as response i got the following
{
"input": {
"text": "increase the temperature of ac"
}-
"context": {
"conversation_id": "5a7ce4c2-c6be-4cb8-b728-19136457bf28"
"system": {
"dialog_stack": [1]
0: "root"
-
"dialog_turn_counter": 1
"dialog_request_counter": 1
}-
}-
"entities": [1]
0: {
"entity": "appliance"
"location": [2]
0: 28
1: 30
-
"value": "ac"
}-
-
"intents": [1]
0: {
"intent": "turn_up"
"confidence": 0.9854193755106732
}-
-
"output": {
"log_messages": [0]
"text": [0]
"nodes_visited": [1]
0: "node_1_1469526692057"
-
}-
}
It doesnot have any text message in the json output
This is working as intended.
Using the Github Conversation demo, You can find the related node in the JSON by searching for "conditions": "#turn_up". Here is the related block.
{
"go_to": {
"return": null,
"selector": "condition",
"dialog_node": "node_11_1467233013716"
},
"output": {},
"parent": null,
"context": null,
"created": "2016-07-22T04:55:54.661Z",
"metadata": null,
"conditions": "#turn_up",
"description": null,
"dialog_node": "node_10_1467233003109",
"previous_sibling": "node_7_1467232789215"
},
Alternatively you can look up the block in the Conversation UI looking for #turn_up. For example.
The output field is empty. So the output text is not being handled by Conversation.
It has to be handled at the application layer. There are valid reasons for doing this. For example creating an answer store independent makes it easier for a non-technical user to update. Or if you wanted to hand off to something like Retrieve and Rank to find the answer.
In this case, how the Car demo handles this is detailed in the tutorial video, which you can see here.
https://youtu.be/wG2fuliRVNk
Related
Unable to update pricing for plan in sandbox account (PRICING_SCHEME_UPDATE_NOT_ALLOWED)
Request:-
https://api-m.sandbox.paypal.com/v1/billing/plans/P-5TD04514DU568400GMDCGH2I/update-pricing-schemes
{
"pricing_schemes": [{
"billing_cycle_sequence": 2,
"pricing_scheme": {
"fixed_price": {
"value": "50",
"currency_code": "USD"
}
}
}
]
}
Response:-
{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "1f4c7375963cb",
"details": [
{
"issue": "PRICING_SCHEME_UPDATE_NOT_ALLOWED",
"description": "Pricing scheme update is not allowed for the plan."
}
],
"links": [
{
"href": "#",
"rel": "information_link",
"method": "GET"
}
]
}
As the error states, updating the plan's pricing scheme is not allowed. It is not listed as one of the patchable fields.
If you need a new pricing scheme, create a new plan.
I am new in Learning Dialogflow, What i am trying is to save the conversation of user and the bot.
i can already save the user response to the bot but i also want to save the bot response to the firebase.
my code is like this
function HandleSaveToDB(agent){
return admin.database().ref('data').push({
bot_response: request.body.queryResult.queryText,
user_response: request.body.fulfillmentText
});
}
the bot_response is saving but the user_response is not saving.
here is the response of the JSON
{
"responseId": "50359194-cadb-44a4-b649-ebd8e4606fea-425db6e2",
"queryResult": {
"queryText": "Hi i am paul i need help",
"parameters": {
"given-name": "Paul",
"text": ""
},
"allRequiredParamsPresent": true,
"fulfillmentText": "Hi Paul how can i help you today?",
"fulfillmentMessages": [
{
"text": {
"text": [
"Hi Paul how can i help you today?"
]
}
}
],
"intent": {
"name": "projects/chatsimulator-rttunh/agent/intents/dbc7dbf8-ca8d-4f7a-86b5-a0e6eab7e0b5",
"displayName": "Greetings"
},
"intentDetectionConfidence": 1,
"diagnosticInfo": {
"webhook_latency_ms": 4992
},
"languageCode": "en"
},
"webhookStatus": {
"code": 4,
"message": "Webhook call failed. Error: DEADLINE_EXCEEDED."
}
}
I'm presuming you're talking about a Fulfillment function being hit here.
The fulfillmentText is actually located in request.queryResult.fulfillmentText, despite what you see as the output from the diagnostic info.
Please see the spec for the fulfillment request and the queryResult property of that request.
I'm trying to use the AMAZON.LITERAL slot type in my Alexa skill, but when I try building, I see this error:
Build Failed
Slot name "{What}" is used in a sample utterance but not defined in the intent schema. Error code: UndefinedSlotName - Thursday, Apr 12, 2018, 2:08 PM
The slot is named What, and I'm 100% sure it is defined. It builds successfully if I change the slot type to anything except AMAZON.LITERAL.
Here is my entire model:
{
"interactionModel": {
"languageModel": {
"invocationName": "chores",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "Remember",
"slots": [
{
"name": "Who",
"type": "AMAZON.Person"
},
{
"name": "When",
"type": "AMAZON.DATE"
},
{
"name": "What",
"type": "AMAZON.LITERAL"
}
],
"samples": [
"remember {Who} {What} {When}"
]
}
],
"types": []
}
}
}
EDIT:
This is the response I got from Amazon when I submitted the bug:
We are not supporting AMAZON.Literal slot type anymore and we ask
developer to use customer slot type is they have some set of values
but if not then you can use AMAZON.SearchQuery where you will get the
whole query which customer is looking for and same you can use it in
you lambda function.
I faced the same issue. Here's the solution.
You need to define your Sample Utterances as
Remember {Neil | Who} {died | What} {yesterday | When}
Amazon made it mandatory to provide the example inputs along with your Slot names as AMAZON.LITERAL can take in a wide variety of values.
For more information, refer here.
add some sample utterances in below format and it should work:
remember {Jack|Who} {bring fruits|What} {tomorrow|When}
remember {Mark|Who} {pay bills|What} {today|When}
When I am sending text using Watson api NLU with my city which is located in India. I am getting empty entity. It should be come with data entity location. So how can i solve this problem in watson NLU.
The sentence being sent is:
mba college in bhubaneswar
where Bhubaneswar is the city
So based on your comment sentence of:
"mba college in bhubaneswar"
Putting that into NLU and entity detection fails with:
Error: unsupported text language: unknown, Code: 400
The first issue is that because no language is specified, it tries to guess the language. But there is not enough there to guess (even if it is obvious to you).
The second issue is, even if you specify the language it will not fully recognise. This is because it's not a real sentence, it's a fragment.
NLU doesn't just do a keyword lookup, It tries to understand the parts of speech (POS) and from that, determine what the word means.
So if I give it a real sentence it will work. For example:
I go to an MBA college in Bhubaneswar
I used this sample code:
import json
from watson_developer_cloud import NaturalLanguageUnderstandingV1
from watson_developer_cloud.natural_language_understanding_v1 import Features, EntitiesOptions, RelationsOptions
ctx = {
"url": "https://gateway.watsonplatform.net/natural-language-understanding/api",
"username": "USERNAME",
"password": "PASSWORD"
}
version = '2017-02-27'
text = "I go to an MBA college in Bhubaneswar"
#text = "mba college in bhubaneswar"
nlu = NaturalLanguageUnderstandingV1(version=version, username=ctx.get('username'),password=ctx.get('password'))
entities = EntitiesOptions()
relations = RelationsOptions()
response = nlu.analyze(text=text, features=Features(entities=entities,relations=relations),language='en')
print(json.dumps(response, indent=2))
That gives me the following results.
{
"usage": {
"text_units": 1,
"text_characters": 37,
"features": 2
},
"relations": [
{
"type": "basedIn",
"sentence": "I go to an MBA college in Bhubaneswar",
"score": 0.669215,
"arguments": [
{
"text": "college",
"location": [
15,
22
],
"entities": [
{
"type": "Organization",
"text": "college"
}
]
},
{
"text": "Bhubaneswar",
"location": [
26,
37
],
"entities": [
{
"type": "GeopoliticalEntity",
"text": "Bhubaneswar"
}
]
}
]
}
],
"language": "en",
"entities": [
{
"type": "Location",
"text": "Bhubaneswar",
"relevance": 0.33,
"disambiguation": {
"subtype": [
"IndianCity",
"City"
],
"name": "Bhubaneswar",
"dbpedia_resource": "http://dbpedia.org/resource/Bhubaneswar"
},
"count": 1
}
]
}
If it's a case you are only going to get fragments to scan, then #ReeceMed solution will resolve it for you.
Screenshot of NLU Service responseIf the NLU service does not recognise the city you have entered you can create a custom model using Watson Knowledge Studio which can then be deployed to the NLU Service, giving customised entities and relationships.
The pact broker overview page (the index page) displays the verification status of each pact which is very useful. Is it possible to filter this view, by a query parameter or such, so that I can see the verifications for a certain tag? I would like to use this to have an overview of all the prod-tagged pacts and their verifications to make sure that all prod-pacts have been verified when making releases of components.
If not I'm contemplating having a separate pact broker instance for the prod pacts.
Thanks!
It's totally doable. It's just a matter me (or someone else) having the time to do it. I've raised an issue for it here:
https://github.com/pact-foundation/pact_broker/issues/146
In the meantime, you can make your own "dashboard" by making a CI build for each prod tag. I think I may have put this on the gitter channel already.
Call /pacts/provider/PROVIDER/consumer/CONSUMER/latest/prod. Follow the pb:consumer-version relation, then follow the pb:latest-verification-results-where-pacticipant-is-consumer relation.
You'll get this.
{
"success": true,
"providerSummary": {
"successful": [
"B"
],
"failed": [],
"unknown": []
},
"_embedded": {
"verificationResults": [
{
"providerName": "B",
"providerApplicationVersion": "2",
"success": true,
"verificationDate": "2017-10-09T12:34:17+08:00",
"_links": {
"self": {
"title": "Verification result",
"name": "Verification result 2 for Pact between A (v1) and B",
"href": "http://localhost:9292/pacts/provider/B/consumer/A/pact-version/7954fb780aa0db0ea451db4c3c1012fb7f0e1eb4/verification-results/2"
},
"pb:pact-version": {
"title": "Pact",
"name": "Pact between A (v1) and B",
"href": "http://localhost:9292/pacts/provider/B/consumer/A/version/1"
}
}
}
]
},
"_links": {
"self": {
"href": "http://localhost:9292/verification-results/consumer/A/version/1/latest",
"title": "Latest verification results for consumer A version 1"
}
}
}
I'll try and prioritise adding the tagged pacts to the UI.