Skip to content

Commit a1c4f6d

Browse files
committed
feat(assistant-v2): support for search skill added
1 parent 1aefc64 commit a1c4f6d

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

assistant/v2.ts

+42-2
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ namespace AssistantV2 {
429429
topic?: string;
430430
/** 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. */
431431
suggestions?: DialogSuggestion[];
432+
/** The title or introductory text to show before the response. This text is defined in the search skill configuration. */
433+
header?: string;
434+
/** An array of objects containing search results. */
435+
results?: SearchResult[];
432436
}
433437

434438
/** DialogSuggestion. */
@@ -547,15 +551,15 @@ namespace AssistantV2 {
547551
context?: MessageContext;
548552
}
549553

550-
/** A term from the request that was identified as an entity. */
554+
/** The entity value that was recognized in the user input. */
551555
export interface RuntimeEntity {
552556
/** An entity detected in the input. */
553557
entity: string;
554558
/** An array of zero-based character offsets that indicate where the detected entity values begin and end in the input text. */
555559
location: number[];
556560
/** The term in the input text that was recognized as an entity value. */
557561
value: string;
558-
/** A decimal percentage that represents Watson's confidence in the entity. */
562+
/** A decimal percentage that represents Watson's confidence in the recognized entity. */
559563
confidence?: number;
560564
/** Any metadata for the entity. */
561565
metadata?: JsonObject;
@@ -571,6 +575,42 @@ namespace AssistantV2 {
571575
confidence: number;
572576
}
573577

578+
/** SearchResult. */
579+
export interface SearchResult {
580+
/** 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. */
581+
id: string;
582+
/** An object containing search result metadata from the Discovery service. */
583+
result_metadata: SearchResultMetadata;
584+
/** 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. */
585+
body?: string;
586+
/** 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. */
587+
title?: string;
588+
/** The URL of the original data object in its native data source. */
589+
url?: string;
590+
/** An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags. */
591+
highlight?: SearchResultHighlight;
592+
}
593+
594+
/** An object containing segments of text from search results with query-matching text highlighted using HTML <em> tags. */
595+
export interface SearchResultHighlight {
596+
/** An array of strings containing segments taken from body text in the search results, with query-matching substrings highlighted. */
597+
body?: string[];
598+
/** An array of strings containing segments taken from title text in the search results, with query-matching substrings highlighted. */
599+
title?: string[];
600+
/** An array of strings containing segments taken from URLs in the search results, with query-matching substrings highlighted. */
601+
url?: string[];
602+
/** SearchResultHighlight accepts additional properties. */
603+
[propName: string]: any;
604+
}
605+
606+
/** An object containing search result metadata from the Discovery service. */
607+
export interface SearchResultMetadata {
608+
/** 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). */
609+
confidence?: number;
610+
/** 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. */
611+
score?: number;
612+
}
613+
574614
/** SessionResponse. */
575615
export interface SessionResponse {
576616
/** The session ID. */

0 commit comments

Comments
 (0)