From b16bb8e2b97e4602257c6639bd8aad2d80cbb3f1 Mon Sep 17 00:00:00 2001 From: Maggie Johnson-Pint Date: Wed, 5 Oct 2022 16:21:26 -0700 Subject: [PATCH] need to declare results iterator in sample (#23410) --- sdk/cognitivelanguage/ai-language-text/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/cognitivelanguage/ai-language-text/README.md b/sdk/cognitivelanguage/ai-language-text/README.md index e198e13276ca..6d2e2a7ce8bb 100644 --- a/sdk/cognitivelanguage/ai-language-text/README.md +++ b/sdk/cognitivelanguage/ai-language-text/README.md @@ -471,6 +471,8 @@ async function main() { }, ]; const poller = await client.beginAnalyzeBatch(actions, documents, "en"); + const results = await poller.pollUntilDone(); + for await (const actionResult of results) { if (actionResult.kind !== "CustomEntityRecognition") { throw new Error(`Expected a CustomEntityRecognition results but got: ${actionResult.kind}`);