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: 1 addition & 0 deletions tests/results/contrib/prompt_library/CoT.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/results/contrib/prompt_library/ReAct.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/results/contrib/prompt_library/ReWoo.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/results/contrib/prompt_library/tools.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions tests/results/examples/demo/6-code-json.1.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"input": {"source_code": "@SuppressWarnings(\"unchecked\")\npublic static Map<String, String> deserializeOffsetMap(String lastSourceOffset) throws IOException {\n Map<String, String> offsetMap;\n if (lastSourceOffset == null || lastSourceOffset.isEmpty()) { \n offsetMap = new HashMap<>(); \n } else {\n offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class); \n }\n return offsetMap;\n}\n", "repo_info": {"repo": "streamsets/datacollector", "path": "stagesupport/src/main/java/com/.../OffsetUtil.java", "function_name": "OffsetUtil.deserializeOffsetMap"}}, "output": "The provided Java code is a static method named `deserializeOffsetMap` within the `OffsetUtil` class in the StreamSets DataCollector repository's `stagesupport/src/main/java/com/` directory, specifically at `com.streamsets.datacollector.onprem.plugin.kafka.offset.OffsetUtil.java`. This method is designed to deserialize a JSON string containing offset information into a `Map<String, String>` object.\n\nHere's an explanation of the code:\n\n1. **Method Signature:**\n ```java\n @SuppressWarnings(\"unchecked\")\n public static Map<String, String> deserializeOffsetMap(String lastSourceOffset) throws IOException;\n ```\n - The method is declared as `public`, `static`, and returns a `Map<String, String>`.\n - It takes one parameter: `lastSourceOffset` of type `String`.\n - The method throws an `IOException`.\n\n2. **Null and Empty Check:**\n ```java\n if (lastSourceOffset == null || lastSourceOffset.isEmpty()) {\n offsetMap = new HashMap<>(); \n } else {\n // ...\n }\n ```\n - If the input string is either `null` or empty, a new `HashMap<String, String>` named `offsetMap` is created and assigned to it.\n\n3. **Deserialization:**\n ```java\n offsetMap = JSON_MAPPER.readValue(lastSourceOffset, Map.class);\n ```\n - If the input string isn't null or empty, the method uses a `JSON_MAPPER` object (assumed to be an instance of a JSON parser like Jackson's `ObjectMapper`) to deserialize it into a `Map<String, String>`. The `readValue()` function is called with two arguments:\n 1. The input string (`lastSourceOffset`).\n 2. A type argument `Map.class`, indicating that the method expects a map as output.\n\n4. **Return Statement:**\n ```java\n return offsetMap;\n ```\n - After processing, the deserialized or default-constructed `offsetMap` is returned.\n\nIn summary, this function takes a JSON string representing an offset map and returns it as a `Map<String, String>`. If no input string is provided (null or empty), it creates a new empty map; otherwise, it deserializes the given JSON string into a map using a JSON parser. The `@SuppressWarnings(\"unchecked\")` annotation warns about potential unchecked casts in the code but doesn't affect its functionality since `Map<String, String>` is a known type.", "metric": 0.19340463458110513}
24 changes: 24 additions & 0 deletions tests/results/examples/demo/9-react.1.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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:
[{"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. I need to find out when he was born.

Action:
[{"name": "Search", "arguments": {"topic": "Henry Hudson birthdate"}}]
Observation: Page id "henry hudson birthday" does not match any pages. Try another id!
Apologies for the confusion, but it seems there's no specific information available about Henry Hudson's exact birthdate. However, he is estimated to have been born around 1565.


Thought: Since I can't find an exact birthdate, I'll use the approximate year and calculate based on that.


Action:
[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: 460
In the year 2025, it would be approximately 460 years ago that Henry Hudson was born.Action:
[{"name": "Finish", "arguments": {"topic": "460"}}]
Observation:
3 changes: 3 additions & 0 deletions tests/results/examples/prompt_library/gsm8k_cot.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Answer the questions to the best of your abilities.

Result: {'answer': '1. Jacob earns $6 per hour.\n2. Jake earns thrice what Jacob does, so Jake earns 3 * $6 = $18 per hour.\n3. Jake works 8 hours a day, so he earns $18 * 8 = $144 per day.\n4. Jake works 5 days, so he earns $144 * 5 = $720 in 5 days.\nThe answer is $720.'}
1 change: 1 addition & 0 deletions tests/results/examples/prompt_library/gsm8k_react.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Result: {'answer': '$720'}
1 change: 1 addition & 0 deletions tests/results/examples/prompt_library/gsm8k_rewoo.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Result: {'answer': 'Jake earns $18 per hour. In 5 days, working 8 hours a day, Jake works 5 * 8 = 40 hours. Therefore, Jake earns 40 * $18 = $720 in 5 days.\n\nAnswer: $720'}
23 changes: 23 additions & 0 deletions tests/results/examples/react/demo.1.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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:
[{"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. I need to find out when he was born.

Action:
[{"name": "Search", "arguments": {"topic": "Henry Hudson birthdate"}}]
Observation: Page id "henry hudson birthday" does not match any pages. Try another id!
Apologies for the confusion, but it seems there's no specific information available about Henry Hudson's exact birthdate. However, he is estimated to have been born around 1565.


Thought: Since I can't find an exact birthdate, I'll use the approximate year and calculate based on that.


Action:
[{"name": "Calc", "arguments": {"expr": "2025 - 1565"}}]
Observation: 460
In the year 2025, it would be approximately 460 years ago that Henry Hudson was born.Action:
[{"name": "Finish", "arguments": {"topic": "460"}}]
3 changes: 3 additions & 0 deletions tests/results/examples/skeleton-of-thought/tips.0.result

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tests/results/examples/skeleton-of-thought/tips.1.result

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tests/results/examples/tutorial/defs.1.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
'J'aime Paris !'
The translation of "I love Madrid!" into Spanish is: "Me encanta Madrid."
1 change: 1 addition & 0 deletions tests/results/examples/tutorial/independent.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello in French!Bonjour! (Hello!) en Espanol!¡Hola! ¿En qué puedo ayudarte hoy? (Hello! How can I assist you today?)Goodbye!¡Adiós! (Goodbye!)
1 change: 1 addition & 0 deletions tests/results/examples/tutorial/independent_docs.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world!Goodbye world!Hello and goodbye to you too! It seems like you've just greeted the world and bid it farewell in quick succession. I'm here to help, so if you have any questions or need information on a specific topic, feel free to ask. How can I assist you today?
1 change: 1 addition & 0 deletions tests/results/examples/tutorial/independent_docs.1.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello world!Goodbye world!Hello and goodbye! It seems like you've greeted and bid farewell in quick succession. I'm here to help with any questions or tasks you have, so feel free to ask me anything. How can I assist you today?
1 change: 1 addition & 0 deletions tests/results/examples/tutorial/independent_for.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello in FrenchBonjour! (Hello!)en Espanol¡Hola! ¿En qué puedo ayudarte hoy? (Translation: Hello! How can I assist you today?)Goodbye!¡Adiós! (Goodbye!)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The french sentence was: 'J'adore Paris !'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world 4 bye
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xxxx3True
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xxxx3True
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${x}3True
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yyyyxxxx3True
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world 4 bye
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"key": "value"}value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"key": "value"}, {"key2": "value2"}]valuevalue2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
As an assistant living in Europe, I'd be happy to share that the fastest land animal native to this continent is actually the Greyhound. These dogs are renowned for their incredible speed and can reach top speeds of around 43-45 miles per hour (70 km/h). They were originally bred for hunting, particularly for their ability to chase down prey at high velocities.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"role": "user", "content": "answer as if you live in europe", "defsite": "text.0.message"}{"role": "user", "content": "what is the fastest animal where i live?", "defsite": "text.1.text.0.message"}As an assistant living in Europe, I'd be happy to share that the fastest land animal native to this continent is actually the Greyhound dog breed. These dogs are renowned for their incredible speed and agility on the ground. They can reach top speeds of around 45-48 miles per hour (72-77 kilometers per hour), making them one of the fastest animals in Europe.

However, if we consider wild animals, the Cheetah is the fastest land animal globally and can be found in parts of Africa, including regions near the European border with North African countries like Libya and Tunisia. Cheetahs typically reach speeds up to 60-70 miles per hour (97-113 kilometers per hour), but they are not native to Europe.

For a truly European animal, the Greyhound remains the fastest land creature in our region.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The fastest animal is the cheetah. This remarkable creature can reach speeds up to 60-70 miles per hour (97-113 kilometers per hour) in short bursts, making it the world's fastest land animal. Cheetahs have several adaptations that contribute to their incredible speed:

1. **Muscular Build**: Cheetahs have a lean, muscular body with long, slender limbs and a flexible spine. This allows for efficient movement during high-speed chases.
2. **Large Lungs and Heart**: Their lungs are large relative to their size, enabling them to take in more oxygen per breath. A cheetah's heart can beat up to 500 times per minute during intense running, pumping blood rich in oxygen to support its muscles.
3. **Specialized Claws**: Cheetahs have non-retractable claws that provide better grip and traction on the ground while sprinting.
4. **Flexible Spine**: Their spines are flexible, allowing them to maintain a running stride without breaking their backs – unlike other big cats with rigid spines.
5. **Tail**: Cheetahs use their long, bushy tails for balance and steering during high-speed pursuits.
6. **Short, Muscular Legs**: Their legs are short but incredibly powerful due to the muscles attached to them. This helps in generating force for acceleration and maintaining top speed.
7. **Efficient Fat Burning**: Cheetahs have a high proportion of fast-twitch muscle fibers, which burn fat quickly for energy during sprints.
8. **Smooth Skin**: Their skin is smooth to minimize air resistance while running at high speeds.

Despite their incredible speed, cheetahs cannot maintain these top speeds for long distances due to the intense energy expenditure required. They typically chase prey over short to medium distances before tiring and needing to rest.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"a": {"b": 3}}3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[(999, 888)]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[('999', '888')]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
234
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1a2b3c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4a5b6c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3yo3mo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3yo3mo
11 changes: 11 additions & 0 deletions tests/results/pdl-live-react/src-tauri/tests/cli/tips.0.result

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions tests/results/tests/data/optimizer_gsm8k.0.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Answer the questions to the best of your abilities.


The answer is 144
13 changes: 13 additions & 0 deletions tests/test_examples_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ class InputsType:
pathlib.Path("examples")
/ "tutorial"
/ "free_variables.pdl": InputsType(scope=PdlDict({"something": "ABC"})),
pathlib.Path("tests")
/ "data"
/ "optimizer_gsm8k.pdl": InputsType(
scope=PdlDict(
{
"model": "watsonx_text/ibm/granite-3-8b-instruct",
"prompt_pattern": "cot",
"num_demonstrations": 0,
"demonstrations": [],
"question": "The sky currently has 4 times as many cirrus clouds as cumulus clouds, and 12 times as many cumulus clouds as cumulonimbus clouds. If the sky currently has 3 cumulonimbus clouds, how many cirrus clouds are in the sky at this moment?",
}
)
),
}.items()
}

Expand Down