Previously, if choice index is defined, we use the array index to fetch the choice. But the assumption that nth item in an array is the nth choice is invalid. We should use index in the choice instead.
Definition of Done
[X] Code is tested (Unit, E2E)
~[ ] Error handling created / updated & covered by the tests above~
~[ ] Documentation updated~
~[ ] (Optional) Aligned changes with the Java SDK~
Context
AI/gen-ai-hub-sdk-js-backlog#173.
Previously, if choice index is defined, we use the array index to fetch the choice. But the assumption that nth item in an array is the nth choice is invalid. We should use
index
in the choice instead.Definition of Done