Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // URL is the API URL. URL string `json:"url" yaml:"url"` // Version is the version of the API. Version string `json:"version" yaml:"yaml"` // IAMApiKey is the API key. IAMApiKey string `json:"apiKey" yaml:"apiKey"` }
Config is the struct representing the config file. All these data are required to build a new connection.
type Generic ¶
type Generic struct { // ResponseType represents the response type (ex: text) ResponseType string `json:"response_type"` // Text is the text of the value Text string `json:"text"` }
Generic is a response value.
type Intent ¶
type Intent struct { // Intent is the value of the intent. Intent string `json:"intent"` // Confidence is the confidence with which Watson gives the intention. Confidence float32 `json:"confidence"` }
Intent represents a response intent.
type OutputWatson ¶
type OutputWatson struct { // Generics is a slice containing all response values. Generics []*Generic `json:"generic"` // Intents is a slice containing all intents values. Intents []*Intent `json:"intents"` }
OutputWatson contains the response values and the its intents.
type ResponseWatson ¶
type ResponseWatson struct { // StatusCode is the status code of the response. StatusCode int `json:"StatusCode"` // Result is the result of the response. Result *ResultWatson `json:"Result"` }
ResponseWatson is the struct which represents a response given by Watson to a user input. It is useful to parse the string-formatted response to its structured format.
type ResultWatson ¶
type ResultWatson struct { // Output is the output of the response Output *OutputWatson `json:"output"` }
ResultWatson is an intermediate struct of the Watson response.
type Watson ¶
type Watson struct {
// contains filtered or unexported fields
}
Watson is client which communicates with the IBM Watson Assistant API
func (*Watson) CreateSession ¶
CreateSession creates a new client session which would communicate with a IBM Watson Assistant.
func (*Watson) Initialize ¶
Initialize initializes a new IBM Watson client and returns a new Watson struct.