File tree 5 files changed +11
-5
lines changed
5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ uer.delete('contacts') # will remove user entities for given session
148
148
149
149
#Changelog
150
150
151
+ * 1.2.1 - fixed UTF-8 in text-requests
151
152
* 1.2.0 - added configurable session_id and full userEntities support
152
153
* 1.1.4 - removed unused dependency and updated default API version
153
154
* 1.1.3 - fixed non-correctly serialized parameters in new contexts during query send process
Original file line number Diff line number Diff line change 1
1
module ApiAiRuby
2
2
class Constants
3
- VERSION = '1.2.0 '
3
+ VERSION = '1.2.1 '
4
4
DEFAULT_BASE_URL = 'https://api.api.ai/v1/'
5
5
DEFAULT_API_VERSION = '20150910'
6
6
DEFAULT_CLIENT_LANG = 'en'
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ class UserEntitiesRequest < ApiAiRuby::RequestQuery
3
3
4
4
def initialize ( client , options = { } )
5
5
super client , options
6
+ @headers [ 'Content-Type' ] = 'application/json; charset=UTF-8'
6
7
@crud_base_uri = client . api_base_url + 'userEntities'
7
8
@uri = @crud_base_uri
8
9
end
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ class TextRequest < ApiAiRuby::RequestQuery
3
3
def initialize ( client , options = { } )
4
4
options [ :lang ] = client . api_lang
5
5
super client , options
6
+ @headers [ 'Content-Type' ] = 'application/json; charset=UTF-8'
6
7
end
7
8
end
8
9
end
Original file line number Diff line number Diff line change 12
12
expect ( response [ :result ] [ :action ] ) . to eq 'greeting'
13
13
end
14
14
15
+ it 'should correct work with utf-8 entities' do
16
+ response = @client . text_request '你好'
17
+ expect ( response [ :result ] [ :resolvedQuery ] ) . to eq '你好'
18
+ end
15
19
it 'should use input contexts' do
16
20
response = @client . text_request 'Hello' , :resetContexts => true
17
21
expect ( response [ :result ] [ :action ] ) . to eq 'greeting'
36
40
end
37
41
38
42
it 'should send voiceData to API' do
39
- expect ( @client . voice_request ( File . new ( fixture_path + '/hello.wav' ) ) [ :result ] [ :resolvedQuery ] ) . to eq 'hello'
43
+ # expect(@client.voice_request(File.new(fixture_path + '/hello.wav'))[:result][:resolvedQuery]).to eq 'hello'
44
+ # asr was disabled for non-premium users
45
+ expect { @client . voice_request ( File . new ( fixture_path + '/hello.wav' ) ) } . to raise_error ( ApiAiRuby ::RequestError )
40
46
end
41
47
42
48
it 'should correctly set contexts with parameters' do
98
104
@uer . delete ( 'dwarfs' )
99
105
expect { @uer . retrieve ( 'dwarfs' ) } . to raise_error ( ApiAiRuby ::RequestError )
100
106
end
101
-
102
107
end
103
-
104
-
105
108
end
You can’t perform that action at this time.
0 commit comments