Skip to content

Commit 99c404a

Browse files
authored
refactor: rename message field defsite into pdl__defsite (#965)
Signed-off-by: Louis Mandel <[email protected]>
1 parent c692904 commit 99c404a

File tree

24 files changed

+72
-72
lines changed

24 files changed

+72
-72
lines changed

examples/intrinsics/demo-hallucination.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pdl-live-react/src-tauri/src/compile/beeai.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn call_tools(model: &String, parameters: &HashMap<String, Value>) -> PdlBlock {
216216
metadata: None,
217217
body: Message(MessageBlock {
218218
role: Role::Tool,
219-
defsite: None,
219+
pdl__defsite: None,
220220
name: Some("${ tool.function.name }".to_string()),
221221
tool_call_id: Some("${ tool.id }".to_string()),
222222
content: Box::new(Advanced(Block {

pdl-live-react/src-tauri/src/pdl/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ pub struct MessageBlock {
415415

416416
/// pdl_id of block that defined the `content of this message
417417
#[serde(skip_serializing_if = "Option::is_none")]
418-
pub defsite: Option<String>,
418+
pub pdl__defsite: Option<String>,
419419

420420
/// For example, the name of the tool that was invoked, for which this message is the tool response
421421
#[serde(skip_serializing_if = "Option::is_none")]

pdl-live-react/src-tauri/src/pdl/interpreter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ impl<'a> Interpreter<'a> {
10811081
content: Box::new(PdlBlock::String(m.content.clone())),
10821082
name: None,
10831083
tool_call_id: None,
1084-
defsite: None,
1084+
pdl__defsite: None,
10851085
})
10861086
.collect(),
10871087
);
@@ -1094,7 +1094,7 @@ impl<'a> Interpreter<'a> {
10941094
content: Box::new(PdlBlock::String(m.content.clone())),
10951095
name: None,
10961096
tool_call_id: None,
1097-
defsite: None,
1097+
pdl__defsite: None,
10981098
})
10991099
.collect(),
11001100
);
@@ -1476,7 +1476,7 @@ impl<'a> Interpreter<'a> {
14761476
role: block.role.clone(),
14771477
content: Box::new(content_trace),
14781478
name: name,
1479-
defsite: None,
1479+
pdl__defsite: None,
14801480
tool_call_id: tool_call_id,
14811481
}),
14821482
))

pdl-live-react/src/demos/demo1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"kind": "text", "pdl__id": "text", "description": "Simple LLM interaction", "defs": {}, "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "pdl__timing": {"start_nanos": 1742523918021192000, "end_nanos": 1742523918022233000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "defsite": "text.0"}]}, "pdl__result": "[{\"role\": \"user\", \"content\": \"write a hello world example, and explain to me how to run it\", \"defsite\": \"text.0\"}]", "pdl__timing": {"start_nanos": 1742523918129394000, "end_nanos": 1742523918130174000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 489, "prompt_tokens": 24}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "defsite": "text.0"}], "pdl__result": "Sure, I'll provide an example of a \"Hello, World!\" program in two popular programming languages: Python and JavaScript (using Node.js).\n\n**Python:**\n\n```python\n# This is a simple Python script to print \"Hello, World!\"\n\nprint(\"Hello, World!\")\n```\n\nTo run this Python code:\n\n1. Open your preferred text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or Jupyter Notebook.\n2. Copy and paste the above code snippet into a new file with a `.py` extension, e.g., `hello_world.py`.\n3. Save the file in a directory where Python is installed on your system (usually it's located at `C:\\Python39\\` for Python 3.9 or similar).\n4. Open a terminal/command prompt and navigate to the directory containing your `.py` file using the `cd` command, e.g., `cd path/to/your/directory`.\n5. Run the script by typing `python hello_world.py` and pressing Enter. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\n**JavaScript (Node.js):**\n\n```javascript\n// This is a simple JavaScript script to print \"Hello, World!\" using Node.js\n\nconsole.log(\"Hello, World!\");\n```\n\nTo run this JavaScript code on a system that has Node.js installed:\n\n1. Install Node.js from https://nodejs.org/ if you haven't already (it's recommended for running JavaScript on the command line).\n2. Open your terminal or command prompt.\n3. Navigate to the directory where you want to run this script using `cd` command, e.g., `cd path/to/your/directory`.\n4. Create a new file named `hello_world.js` by typing `touch hello_world.js`, then open it with your text editor:\n ```\n nano hello_world.js\n ```\n5. Paste the above JavaScript code into this file, save it (press `Ctrl+X`, then `Y` to confirm, and finally `Enter`).\n6. To run the script from the command line, type `node hello_world.js`. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\nBoth Python and JavaScript scripts achieve the same output \u2013 printing \"Hello, World!\" \u2013 but they're written in different languages and use distinct methods to execute them on a computer system.", "pdl__timing": {"start_nanos": 1742523918129200000, "end_nanos": 1742523958045772000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'll provide an example of a \"Hello, World!\" program in two popular programming languages: Python and JavaScript (using Node.js).\n\n**Python:**\n\n```python\n# This is a simple Python script to print \"Hello, World!\"\n\nprint(\"Hello, World!\")\n```\n\nTo run this Python code:\n\n1. Open your preferred text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or Jupyter Notebook.\n2. Copy and paste the above code snippet into a new file with a `.py` extension, e.g., `hello_world.py`.\n3. Save the file in a directory where Python is installed on your system (usually it's located at `C:\\Python39\\` for Python 3.9 or similar).\n4. Open a terminal/command prompt and navigate to the directory containing your `.py` file using the `cd` command, e.g., `cd path/to/your/directory`.\n5. Run the script by typing `python hello_world.py` and pressing Enter. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\n**JavaScript (Node.js):**\n\n```javascript\n// This is a simple JavaScript script to print \"Hello, World!\" using Node.js\n\nconsole.log(\"Hello, World!\");\n```\n\nTo run this JavaScript code on a system that has Node.js installed:\n\n1. Install Node.js from https://nodejs.org/ if you haven't already (it's recommended for running JavaScript on the command line).\n2. Open your terminal or command prompt.\n3. Navigate to the directory where you want to run this script using `cd` command, e.g., `cd path/to/your/directory`.\n4. Create a new file named `hello_world.js` by typing `touch hello_world.js`, then open it with your text editor:\n ```\n nano hello_world.js\n ```\n5. Paste the above JavaScript code into this file, save it (press `Ctrl+X`, then `Y` to confirm, and finally `Enter`).\n6. To run the script from the command line, type `node hello_world.js`. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\nBoth Python and JavaScript scripts achieve the same output \u2013 printing \"Hello, World!\" \u2013 but they're written in different languages and use distinct methods to execute them on a computer system.", "pdl__timing": {"start_nanos": 1742523918021087000, "end_nanos": 1742523958045857000, "timezone": "EDT"}, "pdl__is_leaf": false}
1+
{"kind": "text", "pdl__id": "text", "description": "Simple LLM interaction", "defs": {}, "text": [{"kind": "data", "pdl__id": "text.0", "defs": {}, "data": {"pdl__expr": "write a hello world example, and explain to me how to run it", "pdl__result": "write a hello world example, and explain to me how to run it"}, "pdl__result": "write a hello world example, and explain to me how to run it", "pdl__timing": {"start_nanos": 1742523918021192000, "end_nanos": 1742523918022233000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "pdl__context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": {"pdl__expr": "ollama_chat/granite3.2:2b", "pdl__result": "ollama_chat/granite3.2:2b"}, "input": {"kind": "data", "pdl__id": "text.1.model", "defs": {}, "data": {"pdl__expr": "${ pdl_context }", "pdl__result": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}]}, "pdl__result": "[{\"role\": \"user\", \"content\": \"write a hello world example, and explain to me how to run it\", \"pdl__defsite\": \"text.0\"}]", "pdl__timing": {"start_nanos": 1742523918129394000, "end_nanos": 1742523918130174000, "timezone": "EDT"}, "pdl__is_leaf": true}, "parameters": {"pdl__expr": null}, "pdl__usage": {"completion_tokens": 489, "prompt_tokens": 24}, "pdl__model_input": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "pdl__defsite": "text.0"}], "pdl__result": "Sure, I'll provide an example of a \"Hello, World!\" program in two popular programming languages: Python and JavaScript (using Node.js).\n\n**Python:**\n\n```python\n# This is a simple Python script to print \"Hello, World!\"\n\nprint(\"Hello, World!\")\n```\n\nTo run this Python code:\n\n1. Open your preferred text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or Jupyter Notebook.\n2. Copy and paste the above code snippet into a new file with a `.py` extension, e.g., `hello_world.py`.\n3. Save the file in a directory where Python is installed on your system (usually it's located at `C:\\Python39\\` for Python 3.9 or similar).\n4. Open a terminal/command prompt and navigate to the directory containing your `.py` file using the `cd` command, e.g., `cd path/to/your/directory`.\n5. Run the script by typing `python hello_world.py` and pressing Enter. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\n**JavaScript (Node.js):**\n\n```javascript\n// This is a simple JavaScript script to print \"Hello, World!\" using Node.js\n\nconsole.log(\"Hello, World!\");\n```\n\nTo run this JavaScript code on a system that has Node.js installed:\n\n1. Install Node.js from https://nodejs.org/ if you haven't already (it's recommended for running JavaScript on the command line).\n2. Open your terminal or command prompt.\n3. Navigate to the directory where you want to run this script using `cd` command, e.g., `cd path/to/your/directory`.\n4. Create a new file named `hello_world.js` by typing `touch hello_world.js`, then open it with your text editor:\n ```\n nano hello_world.js\n ```\n5. Paste the above JavaScript code into this file, save it (press `Ctrl+X`, then `Y` to confirm, and finally `Enter`).\n6. To run the script from the command line, type `node hello_world.js`. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\nBoth Python and JavaScript scripts achieve the same output \u2013 printing \"Hello, World!\" \u2013 but they're written in different languages and use distinct methods to execute them on a computer system.", "pdl__timing": {"start_nanos": 1742523918129200000, "end_nanos": 1742523958045772000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'll provide an example of a \"Hello, World!\" program in two popular programming languages: Python and JavaScript (using Node.js).\n\n**Python:**\n\n```python\n# This is a simple Python script to print \"Hello, World!\"\n\nprint(\"Hello, World!\")\n```\n\nTo run this Python code:\n\n1. Open your preferred text editor or an Integrated Development Environment (IDE) like Visual Studio Code, PyCharm, or Jupyter Notebook.\n2. Copy and paste the above code snippet into a new file with a `.py` extension, e.g., `hello_world.py`.\n3. Save the file in a directory where Python is installed on your system (usually it's located at `C:\\Python39\\` for Python 3.9 or similar).\n4. Open a terminal/command prompt and navigate to the directory containing your `.py` file using the `cd` command, e.g., `cd path/to/your/directory`.\n5. Run the script by typing `python hello_world.py` and pressing Enter. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\n**JavaScript (Node.js):**\n\n```javascript\n// This is a simple JavaScript script to print \"Hello, World!\" using Node.js\n\nconsole.log(\"Hello, World!\");\n```\n\nTo run this JavaScript code on a system that has Node.js installed:\n\n1. Install Node.js from https://nodejs.org/ if you haven't already (it's recommended for running JavaScript on the command line).\n2. Open your terminal or command prompt.\n3. Navigate to the directory where you want to run this script using `cd` command, e.g., `cd path/to/your/directory`.\n4. Create a new file named `hello_world.js` by typing `touch hello_world.js`, then open it with your text editor:\n ```\n nano hello_world.js\n ```\n5. Paste the above JavaScript code into this file, save it (press `Ctrl+X`, then `Y` to confirm, and finally `Enter`).\n6. To run the script from the command line, type `node hello_world.js`. You should see \"Hello, World!\" printed in the terminal or command prompt.\n\nBoth Python and JavaScript scripts achieve the same output \u2013 printing \"Hello, World!\" \u2013 but they're written in different languages and use distinct methods to execute them on a computer system.", "pdl__timing": {"start_nanos": 1742523918021087000, "end_nanos": 1742523958045857000, "timezone": "EDT"}, "pdl__is_leaf": false}

pdl-live-react/src/demos/demo2.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pdl-live-react/src/demos/demo3.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pdl-live-react/src/demos/demo4.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pdl-live-react/src/demos/demo7.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pdl-live-react/src/demos/demo8.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)