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
2 changes: 1 addition & 1 deletion examples/demo/1-hello.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ text:
- model: ollama_chat/granite3.2:2b
parameters:
stop: ["!"]
# include_stop_sequence: true


6 changes: 3 additions & 3 deletions examples/demo/9-react.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ text:
<tool_call>[{"name": "Finish", "arguments": {"topic": "1,800 to 7,000 ft"}}]
contribute: [context]

- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.\n"
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.\n"
- repeat:
text:
- def: thought
model: ollama_chat/granite3.2:8b
parameters:
stop_sequences: "Action:"
stop: ["Action:"]
- "Action:\n"
- def: action
model: ollama_chat/granite3.2:8b
parameters:
stop_sequences: "\n"
stop: ["\n"]
parser: json
- "\nObservation: "
- match: ${ action[0].name }
Expand Down
6 changes: 3 additions & 3 deletions examples/react/demo.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ text:
<tool_call>[{"name": "Finish", "arguments": {"topic": "1,800 to 7,000 ft"}}]
contribute: [context]

- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.\n"
- "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching for a birthday for a person, simply ask for the name of that person.\n"
- repeat:
text:
- def: thought
model: ollama_chat/granite3.2:8b
parameters:
stop_sequences: "Action:"
stop: ["Action:"]
- "Action:\n"
- def: action
model: ollama_chat/granite3.2:8b
parameters:
stop_sequences: "\n"
stop: ["\n"]
parser: json
- match: ${ action[0].name }
with:
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react_call.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ text:
def: lib
- call: ${ lib.react }
args:
question: How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.
question: "How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025. When searching avoid using the words discovery or birthday.\n"
model: ollama_chat/granite3.2:8b


42 changes: 27 additions & 15 deletions examples/react/react_fun.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,35 @@ defs:
- defs:
tools:
data:
- name: Calc
description: Calculator function
arguments:
expr:
type: string
description: Arithmetic expression to calculate
- name: Search
description: Wikipedia search
arguments:
topic:
type: string
description: Topic to search
- type: function
function:
name: Calc
description: Calculator function
parameters:
type: object
properties:
expr:
type: string
description: Arithmetic expression to calculate
required:
- expr
- type: function
function:
name: Search
description: Wikipedia search
parameters:
type: object
properties:
topic:
type: string
description: Topic to search
required:
- topic
- for:
ex: ${ examples }
repeat:
"${ ex }\n"
- "\n"
contribute: [context]
- ${ question }
- "\n"
- role: system
Expand All @@ -47,13 +59,13 @@ defs:
model: ${ model }
parameters:
temperature: 0
stop_sequences: "Action:"
stop: ["Action:"]
- "Action:\n"
- def: action
model: ${ model }
parameters:
temperature: 0
stop_sequences: "\n"
stop: ["\n"]
parser: json
- if: ${ action != prev_action}
then:
Expand Down