diff --git a/services/cognitiveservices/v4.0/qnamaker/knowledgebase.go b/services/cognitiveservices/v4.0/qnamaker/knowledgebase.go index 699817848b04..a7a5ade13ef8 100644 --- a/services/cognitiveservices/v4.0/qnamaker/knowledgebase.go +++ b/services/cognitiveservices/v4.0/qnamaker/knowledgebase.go @@ -55,7 +55,11 @@ func (client KnowledgebaseClient) Create(ctx context.Context, createKbPayload Cr Constraints: []validation.Constraint{{Target: "createKbPayload.Name", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "createKbPayload.Name", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "createKbPayload.Name", Name: validation.MinLength, Rule: 1, Chain: nil}, - }}}}}); err != nil { + }}, + {Target: "createKbPayload.DefaultAnswerUsedForExtraction", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "createKbPayload.DefaultAnswerUsedForExtraction", Name: validation.MaxLength, Rule: 300, Chain: nil}, + {Target: "createKbPayload.DefaultAnswerUsedForExtraction", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}}}}); err != nil { return result, validation.NewError("qnamaker.KnowledgebaseClient", "Create", err.Error()) } diff --git a/services/cognitiveservices/v4.0/qnamaker/models.go b/services/cognitiveservices/v4.0/qnamaker/models.go index a5e23760bc24..691b3d24eddf 100644 --- a/services/cognitiveservices/v4.0/qnamaker/models.go +++ b/services/cognitiveservices/v4.0/qnamaker/models.go @@ -129,6 +129,10 @@ type CreateKbDTO struct { Urls *[]string `json:"urls,omitempty"` // Files - List of files from which to Extract Q-A. Files *[]FileDTO `json:"files,omitempty"` + // EnableHierarchicalExtraction - Enable hierarchical extraction of Q-A from files and urls. Value to be considered False if this field is not present. + EnableHierarchicalExtraction *bool `json:"enableHierarchicalExtraction,omitempty"` + // DefaultAnswerUsedForExtraction - Text string to be used as the answer in any Q-A which has no extracted answer from the document but has a hierarchy. Required when EnableHierarchicalExtraction field is set to True. + DefaultAnswerUsedForExtraction *string `json:"defaultAnswerUsedForExtraction,omitempty"` } // CreateKbInputDTO input to create KB. @@ -389,6 +393,10 @@ type UpdateKbOperationDTO struct { Delete *UpdateKbOperationDTODelete `json:"delete,omitempty"` // Update - An instance of UpdateKbContentsDTO for Update Operation Update *UpdateKbOperationDTOUpdate `json:"update,omitempty"` + // EnableHierarchicalExtraction - Enable hierarchical extraction of Q-A from files and urls. The value set during KB creation will be used if this field is not present. + EnableHierarchicalExtraction *bool `json:"enableHierarchicalExtraction,omitempty"` + // DefaultAnswerUsedForExtraction - Text string to be used as the answer in any Q-A which has no extracted answer from the document but has a hierarchy. Required when EnableHierarchicalExtraction field is set to True. + DefaultAnswerUsedForExtraction *string `json:"defaultAnswerUsedForExtraction,omitempty"` } // UpdateKbOperationDTOAdd an instance of CreateKbInputDTO for add operation diff --git a/services/cognitiveservices/v4.0/qnamakerruntime/models.go b/services/cognitiveservices/v4.0/qnamakerruntime/models.go index eeb9d3630178..a207048f787c 100644 --- a/services/cognitiveservices/v4.0/qnamakerruntime/models.go +++ b/services/cognitiveservices/v4.0/qnamakerruntime/models.go @@ -256,6 +256,8 @@ type QueryDTO struct { ScoreThreshold *float64 `json:"scoreThreshold,omitempty"` // Context - Context object with previous QnA's information. Context *QueryDTOContext `json:"context,omitempty"` + // RankerType - Optional field. Set to 'QuestionOnly' for using a question only Ranker. + RankerType *string `json:"rankerType,omitempty"` // StrictFilters - Find only answers that contain these metadata. StrictFilters *[]MetadataDTO `json:"strictFilters,omitempty"` }