Skip to content

Commit

Permalink
feat(example): add interactive mode support
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu committed Aug 23, 2024
1 parent a401a41 commit e13bab8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions examples/resolve-math-problem.ai.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
# ai run -s examples -f examples/resolve-math-problem.ai.yaml '{content: "1+2*5"}'
# ai run -s examples -f examples/resolve-math-problem.ai.yaml '{content: "There are 80 ostriches and giraffes in a zoo. The ostriches have 40 more legs than the giraffes. So how many ostriches and giraffes are there?"}'

# the question of the user
content: "There are 80 ostriches and giraffes in a zoo. The ostriches have 40 more legs than the giraffes. So how many ostriches and giraffes are there?"
input:
content: {type: "string"}
parameters:
temperature: 0
---
Expand All @@ -11,6 +12,12 @@ system: |-
You are the best at accurately discovering the key equivalent relationships one by one, without missing any key equivalents to solve the problem.
Break down the problem step by step to resolve the problem. and get the result.
---
user: "{{content}}"
assistant: "[[thinking]]"
-> extract-calc-result
- $if: "content"
then:
# API mode to solve the problem
- user: "{{content}}"
- assistant: "[[thinking]]"
- -> extract-calc-result
else:
# Interactive mode, welcome message to the user
- assistant: "I am a math assistant, I can help you to solve the math problem."

0 comments on commit e13bab8

Please sign in to comment.