Documentation
¶
Overview ¶
Package assistantv2 : Operations and models for the AssistantV2 service
Index ¶
- Constants
- type AssistantV2
- func (assistant *AssistantV2) CreateSession(createSessionOptions *CreateSessionOptions) (result *SessionResponse, response *core.DetailedResponse, err error)
- func (assistant *AssistantV2) DeleteSession(deleteSessionOptions *DeleteSessionOptions) (response *core.DetailedResponse, err error)
- func (assistant *AssistantV2) DisableSSLVerification()
- func (assistant *AssistantV2) Message(messageOptions *MessageOptions) (result *MessageResponse, response *core.DetailedResponse, err error)
- func (assistant *AssistantV2) NewCreateSessionOptions(assistantID string) *CreateSessionOptions
- func (assistant *AssistantV2) NewDeleteSessionOptions(assistantID string, sessionID string) *DeleteSessionOptions
- func (assistant *AssistantV2) NewMessageOptions(assistantID string, sessionID string) *MessageOptions
- func (assistant *AssistantV2) SetServiceURL(url string) error
- type AssistantV2Options
- type CaptureGroup
- type CreateSessionOptions
- type DeleteSessionOptions
- type DialogLogMessage
- type DialogNodeAction
- type DialogNodeOutputOptionsElement
- type DialogNodeOutputOptionsElementValue
- type DialogNodesVisited
- type DialogSuggestion
- type DialogSuggestionValue
- type MessageContext
- type MessageContextGlobal
- type MessageContextGlobalSystem
- type MessageContextSkill
- type MessageContextSkills
- type MessageInput
- type MessageInputOptions
- type MessageOptions
- func (options *MessageOptions) SetAssistantID(assistantID string) *MessageOptions
- func (options *MessageOptions) SetContext(context *MessageContext) *MessageOptions
- func (options *MessageOptions) SetHeaders(param map[string]string) *MessageOptions
- func (options *MessageOptions) SetInput(input *MessageInput) *MessageOptions
- func (options *MessageOptions) SetSessionID(sessionID string) *MessageOptions
- type MessageOutput
- type MessageOutputDebug
- type MessageResponse
- type RuntimeEntity
- type RuntimeIntent
- type RuntimeResponseGeneric
- type SearchResult
- type SearchResultHighlight
- func (this *SearchResultHighlight) GetBody() *[]string
- func (this *SearchResultHighlight) GetProperty(Key string) *[]string
- func (this *SearchResultHighlight) GetTitle() *[]string
- func (this *SearchResultHighlight) GetURL() *[]string
- func (this *SearchResultHighlight) SetBody(Body *[]string)
- func (this *SearchResultHighlight) SetProperty(Key string, Value *[]string)
- func (this *SearchResultHighlight) SetTitle(Title *[]string)
- func (this *SearchResultHighlight) SetURL(URL *[]string)
- type SearchResultMetadata
- type SessionResponse
Constants ¶
const ( DialogLogMessage_Level_Error = "error" DialogLogMessage_Level_Info = "info" DialogLogMessage_Level_Warn = "warn" )
Constants associated with the DialogLogMessage.Level property. The severity of the log message.
const ( DialogNodeAction_Type_Client = "client" DialogNodeAction_Type_CloudFunction = "cloud-function" DialogNodeAction_Type_Server = "server" DialogNodeAction_Type_WebAction = "web-action" )
Constants associated with the DialogNodeAction.Type property. The type of action to invoke.
const ( MessageOutputDebug_BranchExitedReason_Completed = "completed" MessageOutputDebug_BranchExitedReason_Fallback = "fallback" )
Constants associated with the MessageOutputDebug.BranchExitedReason property. When `branch_exited` is set to `true` by the Assistant, the `branch_exited_reason` specifies whether the dialog completed by itself or got interrupted.
const ( RuntimeResponseGeneric_ResponseType_ConnectToAgent = "connect_to_agent" RuntimeResponseGeneric_ResponseType_Image = "image" RuntimeResponseGeneric_ResponseType_Option = "option" RuntimeResponseGeneric_ResponseType_Pause = "pause" RuntimeResponseGeneric_ResponseType_Search = "search" RuntimeResponseGeneric_ResponseType_Suggestion = "suggestion" RuntimeResponseGeneric_ResponseType_Text = "text" )
Constants associated with the RuntimeResponseGeneric.ResponseType property. The type of response returned by the dialog node. The specified response type must be supported by the client application or channel.
**Note:** The **suggestion** response type is part of the disambiguation feature, which is only available for Premium users.
const ( RuntimeResponseGeneric_Preference_Button = "button" RuntimeResponseGeneric_Preference_Dropdown = "dropdown" )
Constants associated with the RuntimeResponseGeneric.Preference property. The preferred type of control to display.
const (
MessageInput_MessageType_Text = "text"
)
Constants associated with the MessageInput.MessageType property. The type of user input. Currently, only text input is supported.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssistantV2 ¶
type AssistantV2 struct {
Service *core.BaseService
Version string
}
AssistantV2 : The IBM Watson™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users.
The Assistant v2 API provides runtime methods your client application can use to send user input to an assistant and receive a response.
Version: 2.0 See: https://cloud.ibm.com/docs/services/assistant/
func NewAssistantV2 ¶
func NewAssistantV2(options *AssistantV2Options) (service *AssistantV2, err error)
NewAssistantV2 : Instantiate AssistantV2
func (*AssistantV2) CreateSession ¶
func (assistant *AssistantV2) CreateSession(createSessionOptions *CreateSessionOptions) (result *SessionResponse, response *core.DetailedResponse, err error)
CreateSession : Create a session Create a new session. A session is used to send user input to a skill and receive responses. It also maintains the state of the conversation.
func (*AssistantV2) DeleteSession ¶
func (assistant *AssistantV2) DeleteSession(deleteSessionOptions *DeleteSessionOptions) (response *core.DetailedResponse, err error)
DeleteSession : Delete session Deletes a session explicitly before it times out.
func (*AssistantV2) DisableSSLVerification ¶ added in v1.0.0
func (assistant *AssistantV2) DisableSSLVerification()
DisableSSLVerification bypasses verification of the server's SSL certificate
func (*AssistantV2) Message ¶
func (assistant *AssistantV2) Message(messageOptions *MessageOptions) (result *MessageResponse, response *core.DetailedResponse, err error)
Message : Send user input to assistant Send user input to an assistant and receive a response.
There is no rate limit for this operation.
func (*AssistantV2) NewCreateSessionOptions ¶
func (assistant *AssistantV2) NewCreateSessionOptions(assistantID string) *CreateSessionOptions
NewCreateSessionOptions : Instantiate CreateSessionOptions
func (*AssistantV2) NewDeleteSessionOptions ¶
func (assistant *AssistantV2) NewDeleteSessionOptions(assistantID string, sessionID string) *DeleteSessionOptions
NewDeleteSessionOptions : Instantiate DeleteSessionOptions
func (*AssistantV2) NewMessageOptions ¶
func (assistant *AssistantV2) NewMessageOptions(assistantID string, sessionID string) *MessageOptions
NewMessageOptions : Instantiate MessageOptions
func (*AssistantV2) SetServiceURL ¶ added in v1.0.0
func (assistant *AssistantV2) SetServiceURL(url string) error
SetServiceURL sets the service URL
type AssistantV2Options ¶
type AssistantV2Options struct {
URL string
Authenticator core.Authenticator
Version string
}
AssistantV2Options : Service options
type CaptureGroup ¶
type CaptureGroup struct {
// A recognized capture group for the entity.
Group *string `json:"group" validate:"required"`
// Zero-based character offsets that indicate where the entity value begins and ends in the input text.
Location []int64 `json:"location,omitempty"`
}
CaptureGroup : CaptureGroup struct
type CreateSessionOptions ¶
type CreateSessionOptions struct {
// Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the
// assistant settings and click **API Details**. For information about creating assistants, see the
// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
//
// **Note:** Currently, the v2 API does not support creating assistants.
AssistantID *string `json:"assistant_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
CreateSessionOptions : The CreateSession options.
func (*CreateSessionOptions) SetAssistantID ¶
func (options *CreateSessionOptions) SetAssistantID(assistantID string) *CreateSessionOptions
SetAssistantID : Allow user to set AssistantID
func (*CreateSessionOptions) SetHeaders ¶
func (options *CreateSessionOptions) SetHeaders(param map[string]string) *CreateSessionOptions
SetHeaders : Allow user to set Headers
type DeleteSessionOptions ¶
type DeleteSessionOptions struct {
// Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the
// assistant settings and click **API Details**. For information about creating assistants, see the
// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
//
// **Note:** Currently, the v2 API does not support creating assistants.
AssistantID *string `json:"assistant_id" validate:"required"`
// Unique identifier of the session.
SessionID *string `json:"session_id" validate:"required"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
DeleteSessionOptions : The DeleteSession options.
func (*DeleteSessionOptions) SetAssistantID ¶
func (options *DeleteSessionOptions) SetAssistantID(assistantID string) *DeleteSessionOptions
SetAssistantID : Allow user to set AssistantID
func (*DeleteSessionOptions) SetHeaders ¶
func (options *DeleteSessionOptions) SetHeaders(param map[string]string) *DeleteSessionOptions
SetHeaders : Allow user to set Headers
func (*DeleteSessionOptions) SetSessionID ¶
func (options *DeleteSessionOptions) SetSessionID(sessionID string) *DeleteSessionOptions
SetSessionID : Allow user to set SessionID
type DialogLogMessage ¶
type DialogLogMessage struct {
// The severity of the log message.
Level *string `json:"level" validate:"required"`
// The text of the log message.
Message *string `json:"message" validate:"required"`
}
DialogLogMessage : Dialog log message details.
type DialogNodeAction ¶
type DialogNodeAction struct {
// The name of the action.
Name *string `json:"name" validate:"required"`
// The type of action to invoke.
Type *string `json:"type,omitempty"`
// A map of key/value pairs to be provided to the action.
Parameters map[string]interface{} `json:"parameters,omitempty"`
// The location in the dialog context where the result of the action is stored.
ResultVariable *string `json:"result_variable" validate:"required"`
// The name of the context variable that the client application will use to pass in credentials for the action.
Credentials *string `json:"credentials,omitempty"`
}
DialogNodeAction : DialogNodeAction struct
type DialogNodeOutputOptionsElement ¶
type DialogNodeOutputOptionsElement struct {
// The user-facing label for the option.
Label *string `json:"label" validate:"required"`
// An object defining the message input to be sent to the assistant if the user selects the corresponding option.
Value *DialogNodeOutputOptionsElementValue `json:"value" validate:"required"`
}
DialogNodeOutputOptionsElement : DialogNodeOutputOptionsElement struct
type DialogNodeOutputOptionsElementValue ¶
type DialogNodeOutputOptionsElementValue struct {
// An input object that includes the input text.
Input *MessageInput `json:"input,omitempty"`
}
DialogNodeOutputOptionsElementValue : An object defining the message input to be sent to the assistant if the user selects the corresponding option.
type DialogNodesVisited ¶
type DialogNodesVisited struct {
// A dialog node that was triggered during processing of the input message.
DialogNode *string `json:"dialog_node,omitempty"`
// The title of the dialog node.
Title *string `json:"title,omitempty"`
// The conditions that trigger the dialog node.
Conditions *string `json:"conditions,omitempty"`
}
DialogNodesVisited : DialogNodesVisited struct
type DialogSuggestion ¶
type DialogSuggestion struct {
// The user-facing label for the disambiguation option. This label is taken from the **user_label** property of the
// corresponding dialog node.
Label *string `json:"label" validate:"required"`
// An object defining the message input to be sent to the assistant if the user selects the corresponding
// disambiguation option.
Value *DialogSuggestionValue `json:"value" validate:"required"`
// The dialog output that will be returned from the Watson Assistant service if the user selects the corresponding
// option.
Output map[string]interface{} `json:"output,omitempty"`
}
DialogSuggestion : DialogSuggestion struct
type DialogSuggestionValue ¶
type DialogSuggestionValue struct {
// An input object that includes the input text.
Input *MessageInput `json:"input,omitempty"`
}
DialogSuggestionValue : An object defining the message input to be sent to the assistant if the user selects the corresponding disambiguation option.
type MessageContext ¶
type MessageContext struct {
// Information that is shared by all skills used by the Assistant.
Global *MessageContextGlobal `json:"global,omitempty"`
// Information specific to particular skills used by the Assistant.
//
// **Note:** Currently, only a single property named `main skill` is supported. This object contains variables that
// apply to the dialog skill used by the assistant.
Skills *MessageContextSkills `json:"skills,omitempty"`
}
MessageContext : MessageContext struct
type MessageContextGlobal ¶
type MessageContextGlobal struct {
// Built-in system properties that apply to all skills used by the assistant.
System *MessageContextGlobalSystem `json:"system,omitempty"`
}
MessageContextGlobal : Information that is shared by all skills used by the Assistant.
type MessageContextGlobalSystem ¶
type MessageContextGlobalSystem struct {
// The user time zone. The assistant uses the time zone to correctly resolve relative time references.
Timezone *string `json:"timezone,omitempty"`
// A string value that identifies the user who is interacting with the assistant. The client must provide a unique
// identifier for each individual end user who accesses the application. For Plus and Premium plans, this user ID is
// used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab
// characters.
UserID *string `json:"user_id,omitempty"`
// A counter that is automatically incremented with each turn of the conversation. A value of 1 indicates that this is
// the the first turn of a new conversation, which can affect the behavior of some skills (for example, triggering the
// start node of a dialog).
TurnCount *int64 `json:"turn_count,omitempty"`
}
MessageContextGlobalSystem : Built-in system properties that apply to all skills used by the assistant.
type MessageContextSkill ¶ added in v0.2.0
type MessageContextSkill struct {
// Arbitrary variables that can be read and written by a particular skill.
UserDefined map[string]interface{} `json:"user_defined,omitempty"`
}
MessageContextSkill : Contains information specific to a particular skill used by the Assistant.
type MessageContextSkills ¶
type MessageContextSkills map[string]interface{}
MessageContextSkills : Information specific to particular skills used by the Assistant.
**Note:** Currently, only a single property named `main skill` is supported. This object contains variables that apply to the dialog skill used by the assistant.
func (*MessageContextSkills) GetProperty ¶ added in v0.9.0
func (this *MessageContextSkills) GetProperty(Key string) *MessageContextSkill
GetProperty : Allow user to get arbitrary property
func (*MessageContextSkills) SetProperty ¶ added in v0.9.0
func (this *MessageContextSkills) SetProperty(Key string, Value *MessageContextSkill)
SetProperty : Allow user to set arbitrary property
type MessageInput ¶
type MessageInput struct {
// The type of user input. Currently, only text input is supported.
MessageType *string `json:"message_type,omitempty"`
// The text of the user input. This string cannot contain carriage return, newline, or tab characters.
Text *string `json:"text,omitempty"`
// Optional properties that control how the assistant responds.
Options *MessageInputOptions `json:"options,omitempty"`
// Intents to use when evaluating the user input. Include intents from the previous response to continue using those
// intents rather than trying to recognize intents in the new input.
Intents []RuntimeIntent `json:"intents,omitempty"`
// Entities to use when evaluating the message. Include entities from the previous response to continue using those
// entities rather than detecting entities in the new input.
Entities []RuntimeEntity `json:"entities,omitempty"`
// For internal use only.
SuggestionID *string `json:"suggestion_id,omitempty"`
}
MessageInput : An input object that includes the input text.
type MessageInputOptions ¶
type MessageInputOptions struct {
// Whether to return additional diagnostic information. Set to `true` to return additional information under the
// `output.debug` key.
Debug *bool `json:"debug,omitempty"`
// Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes.
// **Note:** This does not affect `turn_count` or any other context variables.
Restart *bool `json:"restart,omitempty"`
// Whether to return more than one intent. Set to `true` to return all matching intents.
AlternateIntents *bool `json:"alternate_intents,omitempty"`
// Whether to return session context with the response. If you specify `true`, the response will include the `context`
// property.
ReturnContext *bool `json:"return_context,omitempty"`
}
MessageInputOptions : Optional properties that control how the assistant responds.
type MessageOptions ¶
type MessageOptions struct {
// Unique identifier of the assistant. To find the assistant ID in the Watson Assistant user interface, open the
// assistant settings and click **API Details**. For information about creating assistants, see the
// [documentation](https://cloud.ibm.com/docs/services/assistant?topic=assistant-assistant-add#assistant-add-task).
//
// **Note:** Currently, the v2 API does not support creating assistants.
AssistantID *string `json:"assistant_id" validate:"required"`
// Unique identifier of the session.
SessionID *string `json:"session_id" validate:"required"`
// An input object that includes the input text.
Input *MessageInput `json:"input,omitempty"`
// State information for the conversation. The context is stored by the assistant on a per-session basis. You can use
// this property to set or modify context variables, which can also be accessed by dialog nodes.
Context *MessageContext `json:"context,omitempty"`
// Allows users to set headers to be GDPR compliant
Headers map[string]string
}
MessageOptions : The Message options.
func (*MessageOptions) SetAssistantID ¶
func (options *MessageOptions) SetAssistantID(assistantID string) *MessageOptions
SetAssistantID : Allow user to set AssistantID
func (*MessageOptions) SetContext ¶
func (options *MessageOptions) SetContext(context *MessageContext) *MessageOptions
SetContext : Allow user to set Context
func (*MessageOptions) SetHeaders ¶
func (options *MessageOptions) SetHeaders(param map[string]string) *MessageOptions
SetHeaders : Allow user to set Headers
func (*MessageOptions) SetInput ¶
func (options *MessageOptions) SetInput(input *MessageInput) *MessageOptions
SetInput : Allow user to set Input
func (*MessageOptions) SetSessionID ¶
func (options *MessageOptions) SetSessionID(sessionID string) *MessageOptions
SetSessionID : Allow user to set SessionID
type MessageOutput ¶
type MessageOutput struct {
// Output intended for any channel. It is the responsibility of the client application to implement the supported
// response types.
Generic []RuntimeResponseGeneric `json:"generic,omitempty"`
// An array of intents recognized in the user input, sorted in descending order of confidence.
Intents []RuntimeIntent `json:"intents,omitempty"`
// An array of entities identified in the user input.
Entities []RuntimeEntity `json:"entities,omitempty"`
// An array of objects describing any actions requested by the dialog node.
Actions []DialogNodeAction `json:"actions,omitempty"`
// Additional detailed information about a message response and how it was generated.
Debug *MessageOutputDebug `json:"debug,omitempty"`
// An object containing any custom properties included in the response. This object includes any arbitrary properties
// defined in the dialog JSON editor as part of the dialog node output.
UserDefined map[string]interface{} `json:"user_defined,omitempty"`
}
MessageOutput : Assistant output to be rendered or processed by the client.
type MessageOutputDebug ¶
type MessageOutputDebug struct {
// An array of objects containing detailed diagnostic information about the nodes that were triggered during processing
// of the input message.
NodesVisited []DialogNodesVisited `json:"nodes_visited,omitempty"`
// An array of up to 50 messages logged with the request.
LogMessages []DialogLogMessage `json:"log_messages,omitempty"`
// Assistant sets this to true when this message response concludes or interrupts a dialog.
BranchExited *bool `json:"branch_exited,omitempty"`
// When `branch_exited` is set to `true` by the Assistant, the `branch_exited_reason` specifies whether the dialog
// completed by itself or got interrupted.
BranchExitedReason *string `json:"branch_exited_reason,omitempty"`
}
MessageOutputDebug : Additional detailed information about a message response and how it was generated.
type MessageResponse ¶
type MessageResponse struct {
// Assistant output to be rendered or processed by the client.
Output *MessageOutput `json:"output" validate:"required"`
// State information for the conversation. The context is stored by the assistant on a per-session basis. You can use
// this property to access context variables.
//
// **Note:** The context is included in message responses only if **return_context**=`true` in the message request.
Context *MessageContext `json:"context,omitempty"`
}
MessageResponse : A response from the Watson Assistant service.
type RuntimeEntity ¶
type RuntimeEntity struct {
// An entity detected in the input.
Entity *string `json:"entity" validate:"required"`
// An array of zero-based character offsets that indicate where the detected entity values begin and end in the input
// text.
Location []int64 `json:"location" validate:"required"`
// The term in the input text that was recognized as an entity value.
Value *string `json:"value" validate:"required"`
// A decimal percentage that represents Watson's confidence in the recognized entity.
Confidence *float64 `json:"confidence,omitempty"`
// Any metadata for the entity.
Metadata map[string]interface{} `json:"metadata,omitempty"`
// The recognized capture groups for the entity, as defined by the entity pattern.
Groups []CaptureGroup `json:"groups,omitempty"`
}
RuntimeEntity : The entity value that was recognized in the user input.
type RuntimeIntent ¶
type RuntimeIntent struct {
// The name of the recognized intent.
Intent *string `json:"intent" validate:"required"`
// A decimal percentage that represents Watson's confidence in the intent.
Confidence *float64 `json:"confidence" validate:"required"`
}
RuntimeIntent : An intent identified in the user input.
type RuntimeResponseGeneric ¶ added in v0.12.0
type RuntimeResponseGeneric struct {
// The type of response returned by the dialog node. The specified response type must be supported by the client
// application or channel.
//
// **Note:** The **suggestion** response type is part of the disambiguation feature, which is only available for
// Premium users.
ResponseType *string `json:"response_type" validate:"required"`
// The text of the response.
Text *string `json:"text,omitempty"`
// How long to pause, in milliseconds.
Time *int64 `json:"time,omitempty"`
// Whether to send a "user is typing" event during the pause.
Typing *bool `json:"typing,omitempty"`
// The URL of the image.
Source *string `json:"source,omitempty"`
// The title or introductory text to show before the response.
Title *string `json:"title,omitempty"`
// The description to show with the the response.
Description *string `json:"description,omitempty"`
// The preferred type of control to display.
Preference *string `json:"preference,omitempty"`
// An array of objects describing the options from which the user can choose.
Options []DialogNodeOutputOptionsElement `json:"options,omitempty"`
// A message to be sent to the human agent who will be taking over the conversation.
MessageToHumanAgent *string `json:"message_to_human_agent,omitempty"`
// A label identifying the topic of the conversation, derived from the **user_label** property of the relevant node.
Topic *string `json:"topic,omitempty"`
// An array of objects describing the possible matching dialog nodes from which the user can choose.
//
// **Note:** The **suggestions** property is part of the disambiguation feature, which is only available for Premium
// users.
Suggestions []DialogSuggestion `json:"suggestions,omitempty"`
// The title or introductory text to show before the response. This text is defined in the search skill configuration.
Header *string `json:"header,omitempty"`
// An array of objects containing search results.
Results []SearchResult `json:"results,omitempty"`
}
RuntimeResponseGeneric : RuntimeResponseGeneric struct
type SearchResult ¶ added in v0.10.0
type SearchResult struct {
// The unique identifier of the document in the Discovery service collection.
//
// This property is included in responses from search skills, which are a beta feature available only to Plus or
// Premium plan users.
ID *string `json:"id" validate:"required"`
// An object containing search result metadata from the Discovery service.
ResultMetadata *SearchResultMetadata `json:"result_metadata" validate:"required"`
// A description of the search result. This is taken from an abstract, summary, or highlight field in the Discovery
// service response, as specified in the search skill configuration.
Body *string `json:"body,omitempty"`
// The title of the search result. This is taken from a title or name field in the Discovery service response, as
// specified in the search skill configuration.
Title *string `json:"title,omitempty"`
// The URL of the original data object in its native data source.
URL *string `json:"url,omitempty"`
// An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags.
Highlight *SearchResultHighlight `json:"highlight,omitempty"`
}
SearchResult : SearchResult struct
type SearchResultHighlight ¶ added in v0.10.0
type SearchResultHighlight map[string]interface{}
SearchResultHighlight : An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags.
func (*SearchResultHighlight) GetBody ¶ added in v0.10.0
func (this *SearchResultHighlight) GetBody() *[]string
GetBody : Allow user to get Body
func (*SearchResultHighlight) GetProperty ¶ added in v0.10.0
func (this *SearchResultHighlight) GetProperty(Key string) *[]string
GetProperty : Allow user to get arbitrary property
func (*SearchResultHighlight) GetTitle ¶ added in v0.10.0
func (this *SearchResultHighlight) GetTitle() *[]string
GetTitle : Allow user to get Title
func (*SearchResultHighlight) GetURL ¶ added in v0.10.0
func (this *SearchResultHighlight) GetURL() *[]string
GetURL : Allow user to get URL
func (*SearchResultHighlight) SetBody ¶ added in v0.10.0
func (this *SearchResultHighlight) SetBody(Body *[]string)
SetBody : Allow user to set Body
func (*SearchResultHighlight) SetProperty ¶ added in v0.10.0
func (this *SearchResultHighlight) SetProperty(Key string, Value *[]string)
SetProperty : Allow user to set arbitrary property
func (*SearchResultHighlight) SetTitle ¶ added in v0.10.0
func (this *SearchResultHighlight) SetTitle(Title *[]string)
SetTitle : Allow user to set Title
func (*SearchResultHighlight) SetURL ¶ added in v0.10.0
func (this *SearchResultHighlight) SetURL(URL *[]string)
SetURL : Allow user to set URL
type SearchResultMetadata ¶ added in v0.10.0
type SearchResultMetadata struct {
// The confidence score for the given result. For more information about how the confidence is calculated, see the
// Discovery service [documentation](../discovery#query-your-collection).
Confidence *float64 `json:"confidence,omitempty"`
// An unbounded measure of the relevance of a particular result, dependent on the query and matching document. A higher
// score indicates a greater match to the query parameters.
Score *float64 `json:"score,omitempty"`
}
SearchResultMetadata : An object containing search result metadata from the Discovery service.
type SessionResponse ¶
type SessionResponse struct {
// The session ID.
SessionID *string `json:"session_id" validate:"required"`
}
SessionResponse : SessionResponse struct