Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Note that call #3 is the observer that goes in "100 Continue" state type of suspense until such time as call #4 is POSTED. Then call #3 is the observer of interim results generated by the server's consumption of the mic's streams bytes POSTED in #4. Calls 1 and 2 for session create, session init()
- ==== CALL 1 ====
- curl -v -X POST -k "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions" -u d3b3:l7Yo -d ""
- * About to connect() to gateway.watsonplatform.net port 8443 (#0)
- * Trying 23.246.237.54...
- * connected
- * Connected to gateway.watsonplatform.net (23.246.237.54) port 8443 (#0)
- * successfully set certificate verify locations:
- * CAfile: /etc/ssl/certs/ca-certificates.crt
- CApath: none
- * SSLv3, TLS handshake, Client hello (1):
- * SSL connection using AES256-SHA
- * Server certificate:
- * subject: C=US; ST=New York; L=Armonk; O=International Business Machines Corporation; CN=gateway.watsonplatform.net
- * start date: 2014-09
- * expire date: 2017-09
- * subjectAltName: gateway.watsonplatform.net matched
- * issuer: C=US; O
- * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
- * Server auth using Basic with user 'ef38e'
- > POST /speech-to-text-beta/api/v1/sessions HTTP/1.1
- > Authorization: Basic ZTM5ZTA2ZTItZDM4Ny00MTBlLWE3MTctZDNiM2ZiM2VmMzhlOkJuam5wNGlGbDdZbw==
- > User-Agent: curl/7.28.1-DEV
- > Host: gateway.watsonplatform.net:8443
- > Accept: */*
- > Content-Length: 0
- > Content-Type: application/x-www-form-urlencoded
- >
- < HTTP/1.1 201 Created
- < X-Backside-Transport: OK OK
- < Connection: Keep-Alive
- < Transfer-Encoding: chunked
- < Server: Apache-Coyote/1.1
- < Date: Sun, 15 Feb 2015 02:01:22 GMT
- < Set-Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962 ***** save this value for successive calls ****
- < X-Zuul: zuul
- < X-Zuul-instance: unknown
- < X-Zuul-Filter-Executions: Routing[SUCCESS][1ms], ParseHostFilter[SUCCESS][0ms], PreDecoration[SUCCESS][0ms], ZuulNFRequest[SUCCESS][7ms]
- < X-Originating-URL: https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions
- < Content-Type: application/json;charset=utf-8
- < X-Client-IP: 108.192.16.200
- < X-Global-Transaction-ID: 6228039
- <
- {
- "new_session_uri": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions/c70affb05d39780f251f976bb1dc895c",
- "recognize": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions/c70affb05d39780f251f976bb1dc895c/recognize",
- "session_id": "c70affb05d39780f251f976bb1dc895c",
- "observe_result": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions/c70affb05d39780f251f976bb1dc895c/observeResult",
- "recognizeWS": "wss://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions/c70affb05d39780f251f976bb1dc895c/recognize"
- *
- ==== CALL 2 ==== Note cookie session != Path/sessionId
- curl -v -X GET -k --header "Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962" https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/sessions/c70affb05d39780f251f976bb1dc895c/recognize -u ef38e:l7Yo
- {
- "session": {
- "recognize": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/recognize",
- "state": "initialized",
- "observe_result": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/observeResult",
- "model": "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel",
- "recognizeWS": "wss://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/recognize"
- }
- ==== CALL 3 =====
- curl -v -X GET -k --header "Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962" "https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/observeResult?interim_results=true" -u f38e:l7Yo
- * About to connect() to gateway.watsonplatform.net port 8443 (#0)
- * Trying 23.246.237.54...
- * connected
- * Connected to gateway.watsonplatform.net (23.246.237.54) port 8443 (#0)
- * successfully set certificate verify locations:
- * CAfile: /etc/ssl/certs/ca-certificates.crt
- CApath: none
- * SSL connection using AES256-SHA
- * Server certificate:
- * subject: C=US; ST=New York; L=Armonk; O=International Business Machines Corporation; CN=gateway.watsonplatform.net
- * start date: 2014-09
- * expire date: 2017-09
- * subjectAltName: gateway.watsonplatform.net matched
- * issuer: C=US; O
- * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
- * Server auth using Basic with user 'f38e'
- > GET /speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/observeResult?interim_results=true HTTP/1.1
- > Authorization: Basic ZTM5ZTA2ZTItZDM4Ny00MTBlLWE3MTctZDNiM2ZiM2VmMzhlOkJuam5wNGlGbDdZbw==
- > User-Agent: curl/7.28.1-DEV
- > Host: gateway.watsonplatform.net:8443
- > Accept: */*
- > Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962
- >
- < HTTP/1.1 200 OK
- < X-Backside-Transport: OK OK
- < Connection: Keep-Alive
- < Transfer-Encoding: chunked
- < Server: Apache-Coyote/1.1
- < Date: Sun, 15 Feb 2015 00:11:09 GMT
- < Last-Modified: Sun, 15 Feb 2015 00:06:32 GMT
- < Content-Disposition: inline; filename="result.json"
- < X-Zuul: zuul
- < X-Zuul-instance: unknown
- < X-Zuul-Filter-Executions: Routing[SUCCESS][0ms], ParseHostFilter[SUCCESS][0ms], PreDecoration[SUCCESS][0ms], ZuulHostRequest[SUCCESS][68380ms]
- < X-Originating-URL: https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/observeResult?interim_results=true
- < Content-Type: application/json
- < X-Client-IP: 108.192.16.200
- < X-Global-Transaction-ID: 170534293
- <
- {
- "results": [
- {
- "alternatives": [
- {
- "transcript": "ha "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how weird "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how were you "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go to "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to this "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the growth "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the grocery "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this we "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week's "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back in "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back in the "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back in the car "
- }
- ],
- "final": false
- }
- ],
- "result_index": 0
- }{
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back in the car "
- }
- ],
- "final": true
- }
- ],
- "result_index": 0
- * Connection #0 to host gateway.watsonplatform.net left intact
- }
- ===== CALL 4 ====
- curl -v -X POST -k --header "Transfer-Encoding: chunked" --header "Content-Type: audio/x-flac; rate=22050" --header "Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962" --data-binary @11.rec https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/recognize -u f38e:Fl7Yo
- * About to connect() to gateway.watsonplatform.net port 8443 (#0)
- * Trying 23.246.237.54...
- * connected
- * Connected to gateway.watsonplatform.net (23.246.237.54) port 8443 (#0)
- * successfully set certificate verify locations:
- * CAfile: /etc/ssl/certs/ca-certificates.crt
- CApath: none
- * SSL connection using AES256-SHA
- * Server certificate:
- * subject: C=US; ST=New York; L=Armonk; O=International Business Machines Corporation; CN=gateway.watsonplatform.net
- * start date: 2014-09
- * expire date: 2017-09
- * subjectAltName: gateway.watsonplatform.net matched
- * issuer: C=US; O
- * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
- * Server auth using Basic with user 'f38e'
- > POST /speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/recognize HTTP/1.1
- > Authorization: Basic ZTM5ZTA2ZTItZDM4Ny00MTBlLWE3MTctZDNiM2ZiM2VmMzhlOkJuam5wNGlGbDdZbw==
- > User-Agent: curl/7.28.1-DEV
- > Host: gateway.watsonplatform.net:8443
- > Accept: */*
- > Transfer-Encoding: chunked
- > Content-Type: audio/x-flac; rate=22050
- > Cookie: SESSIONID=c70affb05d39780f251f976bb1dc895c8047962
- > Expect: 100-continue
- >
- < HTTP/1.1 100 Continue
- < X-Note: Gateway Ack
- < HTTP/1.1 200 OK
- < X-Backside-Transport: OK OK
- < Connection: Keep-Alive
- < Transfer-Encoding: chunked
- < Server: Apache-Coyote/1.1
- < Date: Sun, 15 Feb 2015 00:12:17 GMT
- < Content-Disposition: inline; filename="result.json"
- < X-Zuul: zuul
- < X-Zuul-instance: unknown
- < X-Zuul-Filter-Executions: Routing[SUCCESS][0ms], ParseHostFilter[SUCCESS][0ms], PreDecoration[SUCCESS][0ms], ZuulHostRequest[SUCCESS][7962ms]
- < X-Originating-URL: https://gateway.watsonplatform.net:8443/speech-to-text-beta/api/v1/models/WatsonModel/sessions/c70affb05d39780f251f976bb1dc895c/recognize
- < Content-Type: application/json
- < X-Client-IP: 108.192.16.200
- < X-Global-Transaction-ID: 173706517
- <
- {
- "results": [
- {
- "alternatives": [
- {
- "transcript": "harley how are you we have to go down to the store and see if we can get the groceries for this week so we can bring them back in the car "
- }
- ],
- "final": true
- }
- ],
- "result_index": 0
- * Connection #0 to host gateway.watsonplatform.net left intact
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement