Skip to content

Commit 00858e3

Browse files
author
spoeck
committed
doc: add entities
1 parent fb20957 commit 00858e3

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ For using your own speech recognition:
8585

8686

8787
### Contexts
88-
Set contexts (will take affect on next startListening or queryRequest):
88+
Set [contexts](https://api.ai/docs/reference/agent/contexts) (will take affect on next startListening or queryRequest):
8989
```javascript
9090
const contexts = [{
9191
name: "deals",
@@ -98,6 +98,24 @@ const contexts = [{
9898
ApiAi.setContexts(contexts);
9999
```
100100

101+
### Entities
102+
Set [UserEntities](https://api.ai/docs/reference/agent/userentities) (will take affect on next startListening or queryRequest):
103+
```javascript
104+
const entities = [{
105+
"name":"shop",
106+
"extend":true,
107+
"entries":[
108+
{
109+
"value":"Media Markt",
110+
"synonyms":["Media Markt"]
111+
}
112+
]
113+
}];
114+
115+
ApiAi.setEntities(entities);
116+
```
117+
118+
101119
### Events on Android
102120
Only in Android we have four additional methods: `onListeningStarted`, `onListeningCanceled`, `onListeningFinished` and `onAudioLevel`. In iOS they will be never called:
103121
```javascript
@@ -157,15 +175,16 @@ ApiAi.setConfiguration("4xxxxxxxe90xxxxxxxxc372", ApiAi.LANG_GERMAN);
157175
## Methods
158176
| name | platform | param1 | param2 | param3 |
159177
| --------------------- | -------- | --------- | --------- | --------- |
160-
| `setConfiguration` | both | clientAccessToken: String | languageTag: String | |
161-
| `startListening` | both | resultCallback: (result: object)=>{} | errorCallback: (error: object)=>{} | |
162-
| `finishListening` | ios | | | |
163-
| `requestQuery` | both | query: String | resultCallback: (result: object)=>{} | errorCallback: (error: object)=>{} |
164-
| `onListeningStarted` | android | callback: ()=>{} | | |
165-
| `onListeningCanceled` | android | callback: ()=>{} || |
166-
| `onListeningFinished` | android | callback: ()=>{} | | |
167-
| `onAudioLevel` | android | callback: (level: number)=>{} || |
168-
| `setContexts` | both | array || |
178+
| `setConfiguration` | both | clientAccessToken: String | languageTag: String | |
179+
| `startListening` | both | resultCallback: (result: object)=>{} | errorCallback: (error: object)=>{} | |
180+
| `finishListening` | ios | | | |
181+
| `requestQuery` | both | query: String | resultCallback: (result: object)=>{} | errorCallback: (error: object)=>{} |
182+
| `onListeningStarted` | android | callback: ()=>{} | | |
183+
| `onListeningCanceled` | android | callback: ()=>{} || |
184+
| `onListeningFinished` | android | callback: ()=>{} | | |
185+
| `onAudioLevel` | android | callback: (level: number)=>{} || |
186+
| `setContexts` | both | array || |
187+
| `setEntities` | both | array || |
169188

170189

171190
## Contributors

0 commit comments

Comments
 (0)