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
1 change: 0 additions & 1 deletion examples/callback/repair_prompt.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ lastOf:
- def: raw_output
model: ollama_chat/granite3.2:2b
parameters:
#stop_sequences: "\n\n"
temperature: 0

- lang: python
Expand Down
2 changes: 1 addition & 1 deletion examples/cldk/cldk-assistant.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ text:


parameters:
stop_sequences: "Question"
stop: ["Question"]
temperature: 0
- "\n\n***Executing the above PDL code:\n\n"
- lang: python
Expand Down
8 changes: 4 additions & 4 deletions examples/demo/10-sdg.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defs:
input: ${teacher_input}
parameters:
temperature: 0
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
parser:
regex: '### Question [0-9]+:\s*([^#\n]+)'
Expand Down Expand Up @@ -156,7 +156,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parser:
Expand Down Expand Up @@ -252,7 +252,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: ${ ([teacher_stop_token] + prompt_data.additional_stop_tokens) | join(',') }
stop: ["${ ([teacher_stop_token] + prompt_data.additional_stop_tokens) | join(',') }"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parsed_answer:
Expand Down Expand Up @@ -339,7 +339,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parser:
Expand Down
6 changes: 3 additions & 3 deletions examples/notebooks/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "dfef7096-b7a6-4966-8356-a306e701974b",
"metadata": {
"scrolled": true
Expand Down Expand Up @@ -395,12 +395,12 @@
" - def: thought\n",
" model: replicate/ibm-granite/granite-3.1-8b-instruct\n",
" parameters:\n",
" stop_sequences: \"Act:\"\n",
" stop: [\"Act:\"]\n",
" temperature: 0\n",
" - def: rawAction\n",
" model: replicate/ibm-granite/granite-3.1-8b-instruct\n",
" parameters:\n",
" stop_sequences: \"\\n\"\n",
" stop: [\"\\n\"]\n",
" temperature: 0\n",
" - def: action\n",
" lang: python\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "f3c62df1-0347-4711-acd7-3892cfd5df30",
"metadata": {},
"outputs": [
Expand All @@ -32,7 +32,7 @@
"- \"Hello\\n\"\n",
"- model: \"replicate/ibm-granite/granite-3.1-8b-instruct\"\n",
" parameters:\n",
" stop_sequences: \"!\"\n",
" stop: [\"!\"]\n",
" "
]
},
Expand Down
4 changes: 2 additions & 2 deletions examples/notebooks/notebook_debug.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "f3c62df1-0347-4711-acd7-3892cfd5df30",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -166,7 +166,7 @@
"- Hello,\n",
"- model: \"replicate/ibm-granite/granite-3.1-8b-instruct\"\n",
" parameters:\n",
" stop_sequences: \"!\""
" stop: [\"!\"]"
]
},
{
Expand Down
10 changes: 5 additions & 5 deletions examples/notebooks/pdl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "f3c62df1-0347-4711-acd7-3892cfd5df30",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -75,7 +75,7 @@
"- \"What is the meaning of life?\\n\"\n",
"- model: replicate/ibm-granite/granite-3.2-8b-instruct\n",
" parameters:\n",
" stop_sequences: \"!\"\n",
" stop: [\"!\"]\n",
" include_stop_sequence: true"
]
},
Expand Down Expand Up @@ -153,7 +153,7 @@
]
},
{
"name": "stdin",
"name": "stdout",
"output_type": "stream",
"text": [
">>> What is APR?\n"
Expand All @@ -169,7 +169,7 @@
]
},
{
"name": "stdin",
"name": "stdout",
"output_type": "stream",
"text": [
">>> say it like a poem\n"
Expand Down Expand Up @@ -200,7 +200,7 @@
]
},
{
"name": "stdin",
"name": "stdout",
"output_type": "stream",
"text": [
">>> quit\n"
Expand Down
6 changes: 4 additions & 2 deletions examples/sdk/hello_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"text": [
"Hello\n",
{
"model": "ollama_chat/granite3.2:8b",
"parameters": {"stop_sequences": "!"},
"model": "ollama_chat/granite3.2:2b",
"parameters": {
"stop": ["!"],
},
},
]
}
Expand Down
4 changes: 2 additions & 2 deletions examples/sdk/hello_prog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
text=[
"Hello\n",
LitellmModelBlock(
model="ollama_chat/granite3.2:8b",
parameters=LitellmParameters(stop_sequences="!"), # pyright: ignore
model="ollama_chat/granite3.2:2b",
parameters=LitellmParameters(stop=["!"]), # pyright: ignore
),
]
)
Expand Down
4 changes: 2 additions & 2 deletions examples/sdk/hello_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
HELLO = """
text:
- "Hello\n"
- model: ollama_chat/granite3.2:8b
- model: ollama_chat/granite3.2:2b
parameters:
stop_sequences: '!'
stop: ['!']
"""


Expand Down
8 changes: 4 additions & 4 deletions examples/teacher/teacher.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ defs:
input: ${teacher_input}
parameters:
temperature: 0
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
parser:
regex: '### Question [0-9]+:\s*([^#\n]+)'
Expand Down Expand Up @@ -156,7 +156,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parser:
Expand Down Expand Up @@ -252,7 +252,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: ${ ([teacher_stop_token] + prompt_data.additional_stop_tokens) | join(',') }
stop: ["${ ([teacher_stop_token] + prompt_data.additional_stop_tokens) | join(',') }"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parsed_answer:
Expand Down Expand Up @@ -339,7 +339,7 @@ defs:
model: ${teacher_model}
input: ${teacher_input}
parameters:
stop_sequences: "${teacher_stop_token}"
stop: ["${teacher_stop_token}"]
max_new_tokens: ${prompt_data.max_new_tokens}
temperature: 0
parser:
Expand Down
24 changes: 11 additions & 13 deletions tests/results/examples/demo/9-react.0.result
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.
Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born, given that it's currently 2025.
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.
Thought: I need to find out who discovered the Hudson River and then calculate how many years ago their birthdate was.
Action:
<tool_call>[{"name": "Search", "arguments": {"topic": "Hudson River discoverer"}}]
Observation: The Hudson River was discovered by Henry Hudson in 1609.
Thought: Henry Hudson was born around 1565 to 1570. I need to find the exact birth year and then calculate how many years ago it was from 2025.
[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce.
On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
Thought: Henry Hudson discovered the Hudson River in 1609. He was born around 1565.
Action:
<tool_call>[{"name": "Search", "arguments": {"topic": "Henry Hudson birth year"}}]
Observation: Henry Hudson was born in 1565.
Thought: To find out how many years ago he was born, I subtract his birth year from the current year (2025).
Action:
<tool_call>[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: The result of the calculation is 460.
Thought: Henry Hudson was born 460 years ago.Action:
[{"name": "Finish", "arguments": {"topic": "460 years ago"}}]
[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: 460
Henry Hudson was born around 1565, so he was approximately 460 years ago.Action:
[{"name": "Finish", "arguments": {"topic": "460"}}]
Observation:
24 changes: 11 additions & 13 deletions tests/results/examples/react/demo.0.result
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
How many years ago was the discoverer of the Hudson River born? Keep in mind we are in 2025.
Thought: I need to find out who discovered the Hudson River and then calculate how many years ago they were born, given that it's currently 2025.
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.
Thought: I need to find out who discovered the Hudson River and then calculate how many years ago their birthdate was.
Action:
<tool_call>[{"name": "Search", "arguments": {"topic": "Hudson River discoverer"}}]
Observation: The Hudson River was discovered by Henry Hudson in 1609.
Thought: Henry Hudson was born around 1565 to 1570. I need to find the exact birth year and then calculate how many years ago it was from 2025.
[{"name": "Search", "arguments": {"topic": "Henry Hudson"}}]
Observation: Henry Hudson (c. 1565 – disappeared 23 June 1611) was an English sea explorer and navigator during the early 17th century, best known for his explorations of present-day Canada and parts of the Northeastern United States.
In 1607 and 1608, Hudson made two attempts on behalf of English merchants to find a rumoured Northeast Passage to Cathay via a route above the Arctic Circle. In 1609, he landed in North America on behalf of the Dutch East India Company and explored the region around the modern New York metropolitan area. Looking for a Northwest Passage to Asia on his ship Halve Maen ("Half Moon"), he sailed up the Hudson River, which was later named after him, and thereby laid the foundation for Dutch colonization of the region. His contributions to the exploration of the New World were significant and lasting. His voyages helped to establish European contact with the native peoples of North America and contributed to the development of trade and commerce.
On his final expedition, while still searching for the Northwest Passage, Hudson became the first European to see Hudson Strait and the immense Hudson Bay. In 1611, after wintering on the shore of James Bay, Hudson wanted to press on to the west, but most of his crew mutinied. The mutineers cast Hudson, his son, and six others adrift; what then happened to the Hudsons and their companions is unknown.
Thought: Henry Hudson discovered the Hudson River in 1609. He was born around 1565.
Action:
<tool_call>[{"name": "Search", "arguments": {"topic": "Henry Hudson birth year"}}]
Observation: Henry Hudson was born in 1565.
Thought: To find out how many years ago he was born, I subtract his birth year from the current year (2025).
Action:
<tool_call>[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: The result of the calculation is 460.
Thought: Henry Hudson was born 460 years ago.Action:
[{"name": "Finish", "arguments": {"topic": "460 years ago"}}]
[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: 460
Henry Hudson was born around 1565, so he was approximately 460 years ago.Action:
[{"name": "Finish", "arguments": {"topic": "460"}}]