Skip to content

Commit e345b3b

Browse files
committed
[UPD] minor changes
1 parent 3e8fb99 commit e345b3b

File tree

4 files changed

+47
-16
lines changed

4 files changed

+47
-16
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
All notable changes to this project will be documented in this file.
33

44
---
5+
## [1.4.1](https://github.com/RecastAI/SDK-ios/releases/tag/1.4.1)
6+
7+
#### Features
8+
9+
* Minor changes
10+
11+
## [1.4.0](https://github.com/RecastAI/SDK-ios/releases/tag/1.4.0)
12+
13+
#### Features
14+
15+
* Update to API v1
16+
* Add custom entities
17+
518
## [1.0.0](https://github.com/RecastAI/SDK-ios/releases/tag/1.0.0)
619

720
#### Features
@@ -27,4 +40,4 @@ All notable changes to this project will be documented in this file.
2740
#### Features
2841

2942
* SDK Swift
30-
* Update README
43+
* Update README
1.88 KB
Binary file not shown.

README.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ import RecastAI
3737

3838
class ViewController: UIViewController, HandlerRecastRequestProtocol
3939
{
40-
var app : RecastAPI?
40+
var bot : RecastAPI?
4141

4242
override func viewDidLoad()
4343
{
4444
super.viewDidLoad()
4545
// Do any additional setup after loading the view, typically from a nib.
4646

47-
//Initialise app with token & handlerRecastProtocol
48-
self.app = RecastAPI(token : "YOUR_APP_TOKEN", handlerRecastRequestProtocol: self)
47+
//Initialise bot with token & handlerRecastProtocol
48+
self.bot = RecastAPI(token : "YOUR_BOT_TOKEN", handlerRecastRequestProtocol: self)
4949
}
5050
}
5151
```
@@ -60,7 +60,7 @@ Make text request to Recast.AI API
6060
@IBAction func makeRequest()
6161
{
6262
//Call makeRequest with string parameter to make a text request
63-
self.app?.makeRequest(<#T##request: String##String#>)
63+
self.bot?.makeRequest(<#T##request: String##String#>)
6464
}
6565
```
6666

@@ -81,13 +81,13 @@ Make Voice request to Recast.AI API
8181
{
8282
self.recording = !self.recording
8383
//Call startVoiceRequest to start recording your voice
84-
self.app!.startVoiceRequest()
84+
self.bot!.startVoiceRequest()
8585
}
8686
else
8787
{
8888
self.recording = !self.recording
8989
//Call stopVoiceRequest to stop recording your voice and launch the request to the Recast.AI API
90-
self.app!.stopVoiceRequest()
90+
self.bot!.stopVoiceRequest()
9191
}
9292
}
9393
```
@@ -146,7 +146,7 @@ We will return an error (400: bad_request) if any of these cases is met:
146146

147147
We will return an error (401: unauthorized) if the following case is met:
148148

149-
- The token provided in your request is not linked to any of your apps.
149+
- The token provided in your request is not linked to any of your bots.
150150

151151
### Response
152152

@@ -173,7 +173,7 @@ public class Sentence
173173
public var type : String?
174174
public var polarity : String?
175175
public var action : String?
176-
public var agent : String?
176+
public var agent : String?
177177
public var entities : Entities?
178178
}
179179
```
@@ -216,19 +216,37 @@ public class Entities
216216
}
217217
```
218218

219-
### Accessing Custom Entities
219+
You can print a description of the entity using the description attribute :
220+
```swift
221+
public var description: String
222+
{
223+
return "Custom(value : \(value), raw : \(raw))"
224+
}
225+
```
220226

221-
If you want to get the custom entities you can do it this way :
227+
### Accessing Entities
222228

223-
print(response.sentences![0].entities?.custom)
229+
You can access entities from the first sentence this way :
230+
```swift
231+
response.sentences![0].entities?.age.raw
232+
```
224233

234+
### Accessing Custom Entities
235+
236+
If you want to get custom entities you can do it this way :
237+
```swift
238+
print(response.sentences![0].entities?.custom)
239+
```
240+
Output :
225241
```swift
226242
Optional(["movie": [Custom(value : star wars 8, raw : Star Wars 8)]])
227243
```
228-
If you want to access the array of a specific custom entity :
229244

245+
If you want to access the array of a specific custom entity you can do it with its key:
246+
```swift
230247
print(response.sentences![0].entities?.custom!["movie"]
231-
248+
```
249+
Output :
232250
```swift
233251
Optional([Custom(value : star wars 8, raw : Star Wars 8)])
234252
```

RecastAI.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "RecastAI"
11-
s.version = "1.4.0"
11+
s.version = "1.4.1"
1212
s.summary = "Recast.AI Official iOS SDK in Swift"
1313

1414
# This description is used to generate tags and improve search results.
@@ -17,7 +17,7 @@ s.summary = "Recast.AI Official iOS SDK in Swift"
1717
# * Write the description between the DESC delimiters below.
1818
# * Finally, don't worry about the indent, CocoaPods strips it!
1919
s.description = <<-DESC
20-
Recast.AI Official iOS SDK in Swift. Allows you to make request to your apps.
20+
Recast.AI Official iOS SDK in Swift. Allows you to make request to your bots.
2121
DESC
2222

2323
s.homepage = "https://github.com/RecastAI"

0 commit comments

Comments
 (0)