Git Product home page Git Product logo

go-sdk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-sdk's Issues

json.Unmarshal is failing to parse output generic node

Overview
encoding/json.Unmarshal is failing to unmarshal data structure into assistantv1.DialogNode struct

Expected behavior
By reading a JSON field from Postgresql as json.RawMessage and unmarshaling into assistantv1.DialogNode, the encoding/json library should be able to parse the values into the expected objects

Actual behavior

json: cannot unmarshal object into Go struct field DialogNodeOutput.output.generic of type assistantv1.DialogNodeOutputGenericIntf

It only happens when the DialogNode has an output attribute defined

How to reproduce

  1. Create 2 DialogNodes: 1 with output defined, 1 without output defined
  2. Get the JSON config for those Dialog Nodes
  3. Read the JSON into a json.RawMessage field
  4. Run json.Unmarshal on the json.RawMessage into an assistantv1.DialogNode struct
  5. See parsing failure
  6. Remove the Dialog Node with output defined
  7. Repeat steps from 2-4
  8. Notice the successful run of json.Unmarshal

Screenshots

  1. JSON representation of DialogNodes

dialogNodesJSON

  1. UI representation of DialogNodes

dialogNodesUI

  1. Error unmarshaling DialogNodes

errorUnmarshalingDialogNodeJSON

  1. Dialog Node with output defined removed

afterRemovalOfDialogNodewithOutput

  1. Successful unmarshaling of the remaining DialogNode into the expected data structure

successUnmarshalingWithoutOutputDialogNode

SDK Version
github.com/watson-developer-cloud/go-sdk/v2 v2.2.0

Additional information:

  • OS: Linux
  • Go 1.17-buster

panic: websocket: close 1006 (abnormal closure): unexpected EOF

Overview
I basically use a similar go application to that of the example for Speech to Text that can be found in this repository, only changes i've made were the service url, my IAM api key and the file that i want to get the text of. I basically copy-pasted the websocket example, but i'm getting

panic: websocket: close 1006 (abnormal closure): unexpected EOF

although my mp3 file doesn't seem to be corrupted.

Expected behavior
Print out the converted speech of the audio file in to text.

Actual behavior
This is the full output after running.

panic: websocket: close 1006 (abnormal closure): unexpected EOF

goroutine 14 [running]:
main.myCallBack.OnError(...)
	/home/nikolas/go/src/ibmWatson/main.go:67
github.com/watson-developer-cloud/go-sdk/speechtotextv1.RecognizeListener.OnError(...)
	/home/nikolas/go/src/github.com/watson-developer-cloud/go-sdk/speechtotextv1/websocket_listener.go:70
github.com/watson-developer-cloud/go-sdk/speechtotextv1.RecognizeListener.OnData(0xc0004d20e0, 0x7c6580, 0x9f63e0, 0xc0000c8000, 0xc0000891e0)
	/home/nikolas/go/src/github.com/watson-developer-cloud/go-sdk/speechtotextv1/websocket_listener.go:44 +0x1ed
created by github.com/watson-developer-cloud/go-sdk/speechtotextv1.(*SpeechToTextV1).NewRecognizeListener
	/home/nikolas/go/src/github.com/watson-developer-cloud/go-sdk/speechtotextv1/websocket_listener.go:128 +0x295

Process finished with exit code 2

How to reproduce
This is the actual code:

package main

import (
	"encoding/json"
	"fmt"
	"github.com/IBM/go-sdk-core/core"
	"github.com/watson-developer-cloud/go-sdk/speechtotextv1"
	"os"
)

func main() {
	// Instantiate the Watson Speech To Text service
	service, serviceErr := speechtotextv1.
		NewSpeechToTextV1(&speechtotextv1.SpeechToTextV1Options{
			URL:       "https://gateway-lon.watsonplatform.net/speech-to-text/api",
			IAMApiKey: "<My-Key>",
		})

	// Check successful instantiation
	if serviceErr != nil {
		panic(serviceErr)
	}

	/* RECOGNIZE */

	pwd, _ := os.Getwd()

	// Open file with mp3 to recognize
	audio, audioErr := os.Open(pwd + "/2019_02_27_18_46_40.mp3")
	if audioErr != nil {
		panic(audioErr)
	}

	// callbook can have `OnOpen`, `onData`, `OnClose` and `onError` functions
	callback := myCallBack{}

	recognizeUsingWebsocketOptions := service.
		NewRecognizeUsingWebsocketOptions(audio, "audio/mp3")

	recognizeUsingWebsocketOptions.
		SetModel("en-US_BroadbandModel").
		SetWordConfidence(true).
		SetSpeakerLabels(true).
		SetTimestamps(true)

	service.RecognizeUsingWebsocket(recognizeUsingWebsocketOptions, callback)
}

type myCallBack struct{}

func (cb myCallBack) OnOpen() {
	fmt.Println("Handshake successful")
}

func (cb myCallBack) OnClose() {
	fmt.Println("Closing connection")
}

func (cb myCallBack) OnData(resp *core.DetailedResponse) {
	var speechResults speechtotextv1.SpeechRecognitionResults
	result := resp.GetResult().([]byte)
	json.Unmarshal(result, &speechResults)
	core.PrettyPrint(speechResults, "Recognized audio: ")
}

func (cb myCallBack) OnError(err error) {
	panic(err)
}

SDK Version
v0.8.0

Additional information:

  • OS: Ubuntu 16.04
  • go version go1.12.3 linux/amd64

Additional context
Information about the mp3 file.

$ stat 2019_02_27_18_46_40.mp3 
  File: '2019_02_27_18_46_40.mp3'
  Size: 56586239
  Blocks: 110520
  IO Block: 4096   regular file
Device: 804h/2052d	Inode: 7602323     Links: 1
$ ffprobe 2019_02_27_18_46_40.mp3 
ffprobe version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2007-2018 the FFmpeg developers

[mp3 @ 0x182ad00] Skipping 0 bytes of junk at 0.
[mp3 @ 0x182ad00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '2019_02_27_18_46_40.mp3':
  Duration: 00:58:56.64, start: 0.000000, bitrate: 127 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p, 128 kb/s

Compare Comply ListFeedback does not work

Overview
What is the issue? Be concise and clear.

When invoking the ListFeedback method for Compare Comply, the response is deserialized incorrectly and this produces an error. This is either a bug in the SDK or a flaw in the example in the API ref.

Expected behavior
What did you expect to happen?
I expected the results to be printed to the screen as JSON.

Actual behavior
What actually happened?
I received the following error:

panic: An error occurred while unmarshalling the response body: 'parsing time "2019-04-02T14:11:48.938+0000": extra text: +0000'

coming from this line: panic(responseErr)

How to reproduce
Help us to reproduce what you experienced. Include your code snippets (without credentials)
Build and run this code as is:

package main

import (
  "encoding/json"
  "fmt"
  "github.com/IBM/go-sdk-core/core"
  "github.com/watson-developer-cloud/go-sdk/comparecomplyv1"
)

func main() {
  authenticator := &core.IamAuthenticator{
    ApiKey:     "{apikey}",
  }

  options := &comparecomplyv1.CompareComplyV1Options{
    Version: "2018-10-15",
    Authenticator: authenticator,
  }

  compareComply, compareComplyErr := comparecomplyv1.NewCompareComplyV1(options)

  if compareComplyErr != nil {
    panic(compareComplyErr)
  }

  compareComply.SetServiceURL("{url}")

  result, _, responseErr := compareComply.ListFeedback(
    &comparecomplyv1.ListFeedbackOptions{},
  )

  if responseErr != nil {
    panic(responseErr)
  }
  b, _ := json.MarshalIndent(result, "", "  ")
  fmt.Println(string(b))
}

SDK Version
Please provide the SDK version here.
1.0.0

Specifically, using local clone at comming ab836657457716599066956900b6c52d0e45c970

Additional information:

  • OS: for example, iOS
    iOS
  • Which version of Go are you using?
    1.12.6

[speech-to-text] RecognizeOptions does not support character_insertion_bias

When using custom parameters for STT recognize, such as BackgroundAudioSuppression, MaxAlternatives I noticed there is no setter forCharacterInsertionBias.

Possible solution:

// SetCharacterInsertionBias : Allow user to set CharacterInsertionBias
func (_options *RecognizeOptions) SetCharacterInsertionBias(characterInsertionBias float32) *RecognizeOptions {
	_options.CharacterInsertionBias = core.Float32Ptr(characterInsertionBias)
	return _options
}

[speech-to-text] SpeechRecognitionResult.WordConfidence Unmarshal Error

Dependencies

  • Gorilla Websockets
  • encoding/json

Steps

  • Connect to STT with Gorillas websocket connection, RecognizeOptions.WordConfidence = true, model = ja-JP_NarrowbandModel
  • Wait for message via websocketConnection.ReadMessage()
  • Unmarshal message to speechtotextv1.SpeechRecognitionResults

Expected Behaviour

  • Everything unmarshals nicely and no error

Actual Behaviour

  • Error: json: cannot unmarshal array into Go struct field SpeechRecognitionAlternative.word_confidence of type string
  • If RecognizeOptions.WordConfidence set to false, everything unmarshals correctly

Go SDK version

v0.2.0

Possible Cause

Watson returns SpeechRecognitionAlternative.word_confidence as an array of ["string", int].

Should SpeechRecognitionAlternative.word_confidence type be changed to accommodate this?

Failed to compile due to error on line 72 in language_translator_v3.go

Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

Before you open an issue, please check if a similar issue already exists or has been closed before.

Check service status

  1. For service issues or 5xx errors, first, go to the IBM Cloud status page and check the status of the service.
  2. If the service status is OK, continue with a bug report.

Overview
What is the issue? Be concise and clear.
Compilation failed

Expected behavior
What did you expect to happen?
Compilation to succeed

Actual behavior
What actually happened?
During go build the following error was produced.

go\pkg\mod\github.com\watson-developer-cloud\[email protected]\languagetranslatorv3\language_translator_v3.go:72:41: not enough arguments in call to core.NewBaseService
have (*core.ServiceOptions)
want (*core.ServiceOptions, string, string)

How to reproduce
Help us to reproduce what you experienced. Include your code snippets (without credentials)
go get -u github.com/IBM/go-sdk-core/...
go get -u github.com/watson-developer-cloud/[email protected]

----- Code ------
package main

import (
"fmt"

"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/languagetranslatorv3"

)

func main() {

authenticator := &core.IamAuthenticator{
	ApiKey: "{api_key}",
}

options := &languagetranslatorv3.LanguageTranslatorV3Options{
	Version:       "2018-05-01",
	Authenticator: authenticator,
}

languageTranslator, languageTranslatorErr := languagetranslatorv3.NewLanguageTranslatorV3(options)

if languageTranslatorErr != nil {
	panic(languageTranslatorErr)
}

languageTranslator.SetServiceURL("{url}")

result, _, responseErr := languageTranslator.Identify(
	&languagetranslatorv3.IdentifyOptions{
		Text: core.StringPtr("你好吗h"),
	},
)
if responseErr != nil {
	panic(responseErr)
}
//b, _ := json.MarshalIndent(result, "", "  ")
fmt.Println(*result.Languages[0].Language)

}

Screenshots
If applicable, add screenshots to help explain your problem.

SDK Version
Please provide the SDK version here.
github.com/IBM/go-sdk-core v1.1.0
github.com/watson-developer-cloud/[email protected]

Additional information:

  • OS: for example, iOS

Windows 10

  • Which version of Go are you using?
    go 1.14.3

Additional context
Add any other details about the problem.

I have checked code in language_translator_v3.go

On line 72 the call to baseService, err := core.NewBaseService(serviceOptions) was missing 2 parameters.

I have replace the line with
baseService, err := core.NewBaseService(serviceOptions, DefaultServiceName, "")

and it compiles and executed successfully.

Can not run the example code: An error occurred while processing the operation response.

Overview

I'm quite new to Go so it might work as intended.

When I am running the speech to text example I'm getting the error: panic: An error occurred while processing the operation response.. However, if I just run the WebSocket part it works like a charm.

Expected behavior
I expect to get back recognized audio.

Actual behavior
I'm getting the error: An error occurred while processing the operation response.

How to reproduce
This is how I did it:

curl https://raw.githubusercontent.com/watson-developer-cloud/go-sdk/master/examples/speechtotextv1/speech_to_text_v1.go -o speech_to_text_v1.go
curl https://raw.githubusercontent.com/watson-developer-cloud/go-sdk/master/resources/audio_example.mp3 -o audio_example.mp3

I then made the following changes:

diff --git a/speech_to_text_v1.go b/speech_to_text_v1.go
index 576f3bf..5607c2d 100644
--- a/speech_to_text_v1.go
+++ b/speech_to_text_v1.go
@@ -12,11 +12,11 @@ import (
 func main() {
        // Instantiate the Watson Speech To Text service
        authenticator := &core.IamAuthenticator{
-               ApiKey: os.Getenv("YOUR API KEY"),
+               ApiKey: "<my api key>",
        }
        service, serviceErr := speechtotextv1.
                NewSpeechToTextV1(&speechtotextv1.SpeechToTextV1Options{
-                       URL:           "YOUR SERVICE URL",
+                       URL:           "<my service url>",
                        Authenticator: authenticator,
                })

@@ -30,7 +30,7 @@ func main() {
        pwd, _ := os.Getwd()

        // Open file with mp3 to recognize
-       audio, audioErr := os.Open(pwd + "/../../resources/audio_example.mp3")
+       audio, audioErr := os.Open(pwd + "/audio_example.mp3")
        if audioErr != nil {
                panic(audioErr)
        }
@@ -54,7 +54,7 @@ func main() {
        }

        // Example using websockets!
-       audio, _ = os.Open(pwd + "/../../resources/audio_example.mp3")
+       audio, _ = os.Open(pwd + "/audio_example.mp3")

        // callbook can have `OnOpen`, `onData`, `OnClose` and `onError` functions
        callback := myCallBack{}

and then build and run:

$ go get github.com/IBM/go-sdk-core/core
$ go get github.com/watson-developer-cloud/go-sdk/speechtotextv1
$ go build speech_to_text_v1.go
$ ./speech_to_text_v1
panic: An error occurred while processing the operation response.

goroutine 1 [running]:
main.main()
	speech_to_text_v1.go:48 +0x5bc

However, if I just run the web socket example, it works fine:

diff --git a/speech_to_text_v1.go b/speech_to_text_v1.go
index 576f3bf..2df828e 100644
--- a/speech_to_text_v1.go
+++ b/speech_to_text_v1.go
@@ -29,32 +29,8 @@ func main() {

        pwd, _ := os.Getwd()

-       // Open file with mp3 to recognize
-       audio, audioErr := os.Open(pwd + "/../../resources/audio_example.mp3")
-       if audioErr != nil {
-               panic(audioErr)
-       }
-
-       // Create a new RecognizeOptions for ContentType "audio/mp3"
-       recognizeOptions := service.
-               NewRecognizeOptions(audio).
-               SetContentType("audio/mp3")
-
-       // Call the speechToText Recognize method
-       recognizeResult, _, responseErr := service.Recognize(recognizeOptions)
-
-       // Check successful call
-       if responseErr != nil {
-               panic(responseErr)
-       }
-
-       // Check successful casting
-       if recognizeResult != nil {
-               core.PrettyPrint(recognizeResult, "Recognize")
-       }
-
        // Example using websockets!

Do I miss something?

Additional information:

  • OS: macOS Catalina
  • Go: go version go1.14.3 darwin/amd64

raw audio does not work through websockets but works through http interface

Overview
I am trying to send a raw audio in a file over the websocket interface by using the go sdk, but gets below error back.

{
   "error": "unable to transcode data stream application/octet-stream -> audio/x-float-array "
}

Expected behavior
And the same audio file works if I use http interface instead of websockets. Since it works over http interface then using the websocket interface should not be a problem. So, by using websocket interface it should be able to send me transcript message.

Actual behavior

Recognized audio: :
{}

How to reproduce
It can be reproduced by using the default speechtotext example with raw audio file.

Screenshots
image

SDK Version

github.com/watson-developer-cloud/go-sdk/v2 v2.0.3

Additional information:

  • OS: Windows 10
  • Which version of Go are you using?
go version go1.16 windows/amd64

The official API documentations don't reflect the changes in authentication methods

As the title. While I was working with go-sdk for Watson Assistant, I found that the examples in the official documentation(https://cloud.ibm.com/apidocs/assistant-v1?code=go) not only doesn't work, but also does not reflect recent updates you made (554c926)

To be specific, I failed to build a go program with the example given in the current documentation, but succeeded with your updated example at the commit I mentioned.

I further found that other services have the same problem as well. And I guess it is so for all Watson products.

I think the documentations need to be synced.

Latest go-sdk-core breaks go-sdk

Overview

Using the latest release (0.11.0) of go-sdk, the build fails.
The issue is the dependency of go-sdk-core, a new release was done 3hr ago (version 0.8.0), which modifies the core.ServiceOptions struct.
Since go-sdk doesn't specify exact version, any new project grabs the latest go-sdk-core version, and the results is that on build time it fails.

../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:57:3: unknown field 'Version' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:59:3: unknown field 'Username' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:60:3: unknown field 'Password' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:61:3: unknown field 'IAMApiKey' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:62:3: unknown field 'IAMAccessToken' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:63:3: unknown field 'IAMURL' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:64:3: unknown field 'IAMClientId' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:65:3: unknown field 'IAMClientSecret' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:66:3: unknown field 'ICP4DAccessToken' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:67:3: unknown field 'ICP4DURL' in struct literal of type core.ServiceOptions
../../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/assistantv2/assistant_v2.go:67:3: too many errors

Expected behavior
What did you expect to happen?
I will be able to build... the go-sdk should specify the go-sdk-core version (i.e. not 0.8.0)

Actual behavior
What actually happened?
build fails

How to reproduce
Help us to reproduce what you experienced. Include your code snippets (without credentials)
Clean your mod file and run "go mod tidy", it will fetch the latest and fail.
Screenshots
If applicable, add screenshots to help explain your problem.

SDK Version
Please provide the SDK version here.

Additional information:

  • OS: for example, iOS
  • Which version of Go are you using?

Additional context
Add any other details about the problem.

Workaround
Modify your mod file, by changing the go-sdk-core import version
github.com/IBM/go-sdk-core v0.4.2 // indirect
and then run go mod tidy
this will grab the compatible go-sdk-core release

speechtotextv1 is panicing if the websocket handhake fails

Overview
What is the issue? Be concise and clear.

When a websocket connection cannot be established with the speechtotextv1 service, a panic happens. Specifically, when https://github.com/watson-developer-cloud/go-sdk/blob/master/speechtotextv1/websocket_listener.go#L128 throws a "websocket: bad handshake" error, a panic will result

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x91f5b7]

goroutine 61 [running]:
github.com/gorilla/websocket.(*Conn).WriteMessage(0x0, 0x1, 0xc00060ab60, 0xd8, 0xe0, 0x0, 0x0)
	/go/pkg/mod/github.com/gorilla/[email protected]/conn.go:753 +0x37
github.com/watson-developer-cloud/go-sdk/speechtotextv1.sendStartMessage(0x0, 0xc0001740f0, 0xc0001a3ab0)
	/go/pkg/mod/github.com/watson-developer-cloud/[email protected]/speechtotextv1/websocket_listener.go:81 +0x8b
github.com/watson-developer-cloud/go-sdk/speechtotextv1.RecognizeListener.OnOpen(0xc000030620, 0xe45320, 0xc0003220c0, 0xc0001740f0, 0x0)
	/go/pkg/mod/github.com/watson-developer-cloud/[email protected]/speechtotextv1/websocket_listener.go:25 +0x53
github.com/watson-developer-cloud/go-sdk/speechtotextv1.(*SpeechToTextV1).NewRecognizeListener(0xc000122028, 0xe45320, 0xc0003220c0, 0xc0001740f0, 0xc0001d6e40, 0x32, 0xc00011dc60, 0xc00025a240)
	/go/pkg/mod/github.com/watson-developer-cloud/[email protected]/speechtotextv1/websocket_listener.go:128 +0x20b
github.com/watson-developer-cloud/go-sdk/speechtotextv1.(*SpeechToTextV1).RecognizeUsingWebsocket(0xc000122028, 0xc0001740f0, 0xe45320, 0xc0003220c0)
	/go/pkg/mod/github.com/watson-developer-cloud/[email protected]/speechtotextv1/speech_to_text_v1_adapter.go:138 +0x3db
github.com/graymeta/mf2/extractors/speechwatson.processFile(0xe3c220, 0xc000122028, 0xc0005fc870, 0x29, 0x0, 0x2ada1d9c0, 0xc67c86, 0x14, 0x0, 0x0, ...)

Expected behavior
What did you expect to happen?

For a panic not to occur

Actual behavior
Paniced

SDK Version
Tested on both github.com/watson-developer-cloud/go-sdk v1.0.0 and github.com/watson-developer-cloud/go-sdk v1.2.0

Additional information:

  • OS: for example, iOS
  • Which version of Go are you using?

OS: Centos 7

# go version
go version go1.13.6 linux/amd64

Additional context
Add any other details about the problem.

It really feels like maybe the RecognizeUsingWebsocket should be capable of returning an error if the websocket connection can't be opened. If you don't want to change the interface, then the rest of the package at least needs to be aware that the websocket connection could be nil and protect against that.

Sending streaming audio

Hi,

I could not find an option letting the user to send the streaming audio using the golang sdk, though the same option is available in python sdk version.

I see at the moment it let you send the audio in one go. It would be better if we can have a function taking the audio channel of streaming audio and sends the stop message upon channel closure. Or through a different option.

Ryan

speech_to_text_v1.go: panic: No such child resource

Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

Before you open an issue, please check if a similar issue already exists or has been closed before.

Check service status

  1. For service issues or 5xx errors, first, go to the IBM Cloud status page and check the status of the service.
  2. If the service status is OK, continue with a bug report.

Overview
What is the issue? Be concise and clear.

go run speech_to_text_v1.go fails with this error
panic: No such child resource.

goroutine 1 [running]:
main.main()
/Users/faucherd/Documents/Personal/Programming/mic-to-text/watson/go-sdk/examples/speechtotextv1/speech_to_text_v1.go:48 +0x5bc
exit status 2

Expected behavior
What did you expect to happen?
I expected the program to run and transcribe speech to text. The curl example using the same PIKey and URL works.

Actual behavior
What actually happened?

go run speech_to_text_v1.go
panic: No such child resource.

goroutine 1 [running]:
main.main()
/Users/faucherd/Documents/Personal/Programming/mic-to-text/watson/go-sdk/examples/speechtotextv1/speech_to_text_v1.go:48 +0x5bc
exit status 2

How to reproduce
Help us to reproduce what you experienced. Include your code snippets (without credentials)

macOS
Install go
go get github.com/IBM/go-sdk-core/core
go get github.com/watson-developer-cloud/go-sdk/speechtotextv1
git clone https://github.com/watson-developer-cloud/go-sdk.git
cd go-sdk/examples/speechtotextv1
update speech_to_text_v1.go for working APIKey and URL

Screenshots
If applicable, add screenshots to help explain your problem.

SDK Version
Please provide the SDK version here.

latest git clone

Additional information:

  • OS: for example, iOS
    macOS 10.15.4

  • Which version of Go are you using?
    go version go1.14.2 darwin/amd64

Additional context
Add any other details about the problem.

Thank you

Watson Go SDK major release 1.0.0

We plan to do a official release in late September 2019 and a release candidate in early September 2019. This issue will be updated with more specifics on timings.

These are some goals for the major release:

  • separating out the core as a separate package

Creating this issue for any requirements, ideas, etc that the user community has and would like to see in the major release.

List Logs doesn't work properly

[ListLogs] Fetching logs fails.

Overview:

When trying to fetch logs using the fetch logs method of the SDK, the operation fails due to errors in the types.

Expected Behavior:

Return a list of Watson conversation logs as a json

Actual Behavior:

Received a different list of panics and errors:

panic: interface conversion: interface {} is string, not *string
github.com/watson-developer-cloud/go-sdk/assistantv1.(*Context).GetConversationID(...)
panic: interface conversion: interface {} is []interface {}, not *[]string
github.com/watson-developer-cloud/go-sdk/assistantv1.(*OutputData).GetText(...)
panic: interface conversion: interface {} is string, not *string
github.com/watson-developer-cloud/go-sdk/assistantv1.(*MessageInput).GetText(...)
panic: interface conversion: interface {} is nil, not string
github.com/watson-developer-cloud/go-sdk/assistantv1.(*MessageInput).GetText(...)
An error occurred while unmarshalling the response body: 'json: cannot unmarshal string into Go struct field MessageRequest.logs.request.alternate_intents of type bool' 

Steps to Reproduce

Perform a simple listlogs operations

func test(workspace string) {
	auth2 := core.IamAuthenticator{
		ApiKey: viper.GetString("watson.apikey"),
	}
	service, serviceErr := assistantv1.NewAssistantV1(&assistantv1.AssistantV1Options{
		Version:       viper.GetString("watson.version"),
		URL:           viper.GetString("watson.url"),
		Authenticator: &auth2,
	})
	if serviceErr != nil {
		fmt.Println(serviceErr)
                panic(serviceErr)
	}
	opts := getOptions(core.StringPtr(""), workspace)
	service.ListLogs(opts)
        result, _, responseErr := service.ListLogs(opts)
        if responseErr != nil {
                fmt.Println(responseErr)
                panic(responseErr)
        }
       b, _ := json.MarshalIndent(result, "", "  ")
       fmt.Println(string(b))
}

func getOptions(cursor *string, workspace string) *assistantv1.ListLogsOptions {
	var limit int64
	limit = int64(100)
	filter := getFilter()
	options := assistantv1.ListLogsOptions{
		WorkspaceID: core.StringPtr(viper.GetString("workspace." + workspace)),
		PageLimit:   &limit,
		Filter:      core.StringPtr(filter),
		Cursor:      cursor,
	}
	return &options
}

SDK Version:

v1.0.0

Additional Info:

  • OS: macOS Mojave (version 10.14.4)
  • Version of Go: version go1.13.4 darwin/amd64

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The push permission to the Git repository is required.

semantic-release cannot push the version tag to the branch master on remote Git repository with URL https://[secure]@github.com/watson-developer-cloud/go-sdk.

Please refer to the authentication configuration documentation to configure the Git credentials on your CI environment and make sure the repositoryUrl is configured with a valid Git URL.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Test issue

Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see Stack Overflow.

Before you open an issue, please check if a similar issue already exists or has been closed before.

Check service status

  1. For service issues or 5xx errors, first, go to the IBM Cloud status page and check the status of the service.
  2. If the service status is OK, continue with a bug report.

Overview
What is the issue? Be concise and clear.

Expected behavior
What did you expect to happen?

Actual behavior
What actually happened?

How to reproduce
Help us to reproduce what you experienced. Include your code snippets (without credentials)

Screenshots
If applicable, add screenshots to help explain your problem.

SDK Version
Please provide the SDK version here.

Additional information:

  • OS: for example, iOS
  • Which version of Go are you using?

Additional context
Add any other details about the problem.

As a speech-to-text service go-sdk user I'd like to receive timestamp's end/start's milliseconds part as 3 digits with zero-padding/trailing

In order to not to confuse go-sdk api response users when processing the end/start values,
and in order to follow common milliseconds precision(prefix "milli" eq. 10^-3 according to (SI) Metric System) formatting style
and for user-friendly and evident value
As a speech-to-text service go-sdk user
I'd like to:

  • have a documentation note regarding start/end value milliseconds precision/formatting
    or/and
  • to receive a start, end floating point numbers within timestamps slice formatted as a 3 digit zero-padded/trailed number after point and not a json-default formatted float.

EG:
considering the next json response:

{...
 "timestamps": [["default formatting", 1.1, 1.95], ["with single padded zero", 2.04, 3.54], ["single trailing zero", 4.00, 5.40]]
 ...
}

it isn't clear nor documented whether "default formatting" starts at 1s 1ms or 1s 100ms, "with single padded zero" - at 2s 4ms or 2s 40ms and "single-trailing zero" ends at 5s 40ms or 400ms.
In order to prevent confusion it would be better to format response floats according to milliseconds "common" format -

{...
 "timestamps": [["default formatting", 1.100, 1.950], ["with single padded zero", 2.040, 3.540], ["single padded zero", 4.000, 5.400]]
 ...
}

or to return in unix timestamp like format considering the audio beginning as an epoc start:

{...
 "timestamps": [["default formatting", 1100, 1950], ["with single padded zero", 2040, 3540], ["single padded zero", 4000, 5400]]
 ...
}

Please also take into account available limitations(eg: json size increasing) while choosing between proposals.

text_to_speech_v1.go:81:41: not enough arguments in call to core.NewBaseService

Overview
When I try to import the module of github.com/watson-developer-cloud, the go test command gives the following error:

go test

github.com/watson-developer-cloud/go-sdk/texttospeechv1
../../../go/pkg/mod/github.com/watson-developer-cloud/[email protected]/texttospeechv1/text_to_speech_v1.go:81:41: not enough arguments in call to core.NewBaseService
	have (*core.ServiceOptions)
	want (*core.ServiceOptions, string, string)

Expected behavior
The go test command should give no error

Actual behavior
The above error

How to reproduce
Create a new folder
Go to the new folder and create a hello world golang script
Import the module of github.com/watson-developer-cloud/go-sdk/texttospeechv1
Run go test

SDK Version

github.com/watson-developer-cloud/[email protected]

Additional information:

  • OS: MacOS 10.14.6
  • go version go1.14 darwin/amd64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.