Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions examples/talk/9-react.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
1 change: 1 addition & 0 deletions tests/test_examples_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down