@ai-sdk/provider-utils 5.0.57 → 5.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1311,7 +1311,8 @@ const Experimental_EvaluationLanguageModel = class DecisionLanguageModel {
1311
1311
  const value = values[`q${index}`];
1312
1312
  if (question.type === "choice") {
1313
1313
  const options = Object.keys(question.criteria);
1314
- const choiceIndex = options.findIndex((_, i) => value === `c${i}`);
1314
+ let choiceIndex = options.findIndex((_, i) => value === `c${i}`);
1315
+ if (choiceIndex === -1 && typeof value === "string") choiceIndex = options.indexOf(value);
1315
1316
  if (choiceIndex === -1) throw new InvalidResponseDataError({
1316
1317
  data: values,
1317
1318
  message: `Question "${id}" selected an unknown option.`