@ai-sdk/provider-utils 5.0.58 → 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.
- package/CHANGELOG.md +9 -0
- package/dist/experimental-decision/index.js +2 -1
- package/dist/experimental-decision/index.js.map +1 -1
- package/dist/experimental-evaluation/index.js +2 -1
- package/dist/experimental-evaluation/index.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/decision-language-model.ts +4 -1
- package/src/types/tool-approval-response.ts +7 -0
|
@@ -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
|
-
|
|
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.`
|