-
Notifications
You must be signed in to change notification settings - Fork 123
Auto generated multi turn reference ids are not consumed by qnamaker API when publishing which results in wrong behaviors of multi turn #769
Description
Versions
What CLI version are you using.
What Nodejs version are you using
What command-line interpreters are you using
What OS are you using
Describe the bug
For qna file with multi turn QA pairs, multi turn reference ids will be auto generated when calling the build function in kbCollate.js. But the ids are not from 1 to n to match the original order they are listed in the qna file. However, when calling qnamaker replace api, the qnamaker server will not consume the ids, instead they will mark them from 1 to n based on the order they are listed in the qna file. In such situation, the prompts ids will be disordered which make the multi turn prompts don't work as expected.
To Reproduce
Steps to reproduce the behavior:
- use luis:build to publish a qna file with multi turn(but the ids are not specified)
- check the prompts in qna maker portal to see the prompts are not correct
Expected behavior
The prompts should be right
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
considering below qna content
# ? start multi-turn demo
```
Sure. Happy to do that.
```
**Prompts:**
- [tell joke](#?tell-joke)
- [user guide](#?user-guide)
- [sing song](#?sing-song)
# ?I need help
```
Sure happy to help
```
# ?tell joke
- can you make me laugh?
```
ha ha ha
```
# ?user guide
```
Here is the [user guide](http://contoso.com/userguide.pdf)
```
# ?sing song
- can you sing a song
- make some tunes
```
la la la
```
**Prompts:**
- [Smart answer](#Smart-answer)
# ?Smart answer
- That was a smart answer
```
Thank you! :)
```
The auto generated ids for it by build function in kbCollect.js will be like below
> !# @qna.pair.source = custom editorial < a id = "5"> ## ? start multi-turn demo ```markdown Sure. Happy to do that. ``` **Prompts:** - [tell joke](#1) - [user guide](#2) - [sing song](#3) > !# @qna.pair.source = custom editorial < a id = "6"> ## ? I need help ```markdown Sure happy to help ``` > !# @qna.pair.source = custom editorial < a id = "1"> ## ? tell joke - can you make me laugh? ```markdown ha ha ha ``` > !# @qna.pair.source = custom editorial < a id = "2"> ## ? user guide ```markdown Here is the [user guide](http://contoso.com/userguide.pdf) ``` > !# @qna.pair.source = custom editorial < a id = "3"> ## ? sing song - can you sing a song - make some tunes ```markdown la la la ``` **Prompts:** - [Smart answer](#4) > !# @qna.pair.source = custom editorial < a id = "4"> ## ? Smart answer - That was a smart answer ```markdown Thank you! :) ```
However, when calling qnamaker replace api to publish above qna contents, the real ids generated by api will be 1 to n like below
> !# @qna.pair.source = custom editorial < a id = "1"> ## ? start multi-turn demo ```markdown Sure. Happy to do that. ``` **Prompts:** - [tell joke](#1) - [user guide](#2) - [sing song](#3) > !# @qna.pair.source = custom editorial < a id = "2"> ## ? I need help ```markdown Sure happy to help ``` > !# @qna.pair.source = custom editorial < a id = "3"> ## ? tell joke - can you make me laugh? ```markdown ha ha ha ``` > !# @qna.pair.source = custom editorial < a id = "4"> ## ? user guide ```markdown Here is the [user guide](http://contoso.com/userguide.pdf) ``` > !# @qna.pair.source = custom editorial < a id = "5"> ## ? sing song - can you sing a song - make some tunes ```markdown la la la ``` **Prompts:** - [Smart answer](#4) > !# @qna.pair.source = custom editorial < a id = "6"> ## ? Smart answer - That was a smart answer ```markdown Thank you! :) ```
In this situation, the prompts below will point to the wrong ids.
**Prompts:** - [tell joke](#1) // pointing to **start multi-turn demo** - [user guide](#2) // pointing to **I need help** - [sing song](#3) // pointing to tell **joke**
[bug]