From 5f69e4279f1c0bfee24ed8a030a825344e6c607a Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Wed, 19 Mar 2025 22:06:43 -0400 Subject: [PATCH] Skip test of gsm8k-plan and improve 9-react.pdl --- examples/talk/9-react.pdl | 25 +++++++++++-------------- tests/test_examples_run.py | 1 + 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/talk/9-react.pdl b/examples/talk/9-react.pdl index d190e492e..e551a70aa 100644 --- a/examples/talk/9-react.pdl +++ b/examples/talk/9-react.pdl @@ -72,25 +72,22 @@ text: parameters: stop_sequences: "\n" parser: json + - "\nObservation: " - match: ${ action[0].name } with: - case: 'Search' then: - text: - - "\nObservation: " - - lang: python - code: | - import warnings, wikipedia - warnings.simplefilter("ignore") - try: - result = wikipedia.summary("${ action[0].arguments.topic }") - except wikipedia.WikipediaException as e: - result = str(e) + lang: python + code: | + import warnings, wikipedia + warnings.simplefilter("ignore") + try: + result = wikipedia.summary("${ action[0].arguments.topic }") + except wikipedia.WikipediaException as e: + result = str(e) - case: 'Calc' then: - text: - - "\nObservation: " - - lang: python - code: result = ${ action[0].arguments.expr } + lang: python + code: result = ${ action[0].arguments.expr } - "\n" until: ${ action[0].name == "Finish" } \ No newline at end of file diff --git a/tests/test_examples_run.py b/tests/test_examples_run.py index 47e418368..09cb7afe2 100644 --- a/tests/test_examples_run.py +++ b/tests/test_examples_run.py @@ -38,6 +38,7 @@ pathlib.Path("examples") / "gsm8k" / "math-python.pdl", pathlib.Path("examples") / "gsm8k" / "math.pdl", pathlib.Path("examples") / "gsm8k" / "gsm8.pdl", # TODO: check why + pathlib.Path("examples") / "gsm8k" / "gsm8-plan.pdl", # TODO: check why pathlib.Path("examples") / "tfidf_rag" / "rag.pdl", pathlib.Path("examples") / "react" / "react_call.pdl", pathlib.Path("examples") / "callback" / "repair_prompt.pdl",