Skip to content

Commit c9c6982

Browse files
committed
refactor: rename model_stats -> usage
The litellm field is `usage` so we might as well adopt that. Signed-off-by: Nick Mitchell <[email protected]>
1 parent a9048da commit c9c6982

18 files changed

+83
-81
lines changed

pdl-live-react/demos/run.sh

+1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ pdl --trace "$T"/demo5.json "$TOP"/examples/talk/6-code-json.pdl
1818
pdl --trace "$T"/demo6.json "$UI"/demos/error.pdl || true
1919
pdl --trace "$T"/demo7.json "$TOP"/examples/talk/4-function.pdl
2020
# TODO demo8...
21+
exit
2122
pdl --stream none --trace "$T"/demo9.json "$TOP"/examples/gsm8k/gsm8.pdl

pdl-live-react/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
-e git+https://github.com/IBM/prompt-declaration-language.git#egg=prompt_declaration_language
1+
#-e git+https://github.com/IBM/prompt-declaration-language.git#egg=prompt_declaration_language
2+
-e git+https://github.com/starpit/prompt-declaration-language.git@usage#egg=prompt_declaration_language
23
#prompt-declaration-language==0.4.2

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

+1-1
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": "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": 1742139920050527000, "end_nanos": 1742139920051096000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "pdl__model_stats": {"completion_tokens": 458, "prompt_tokens": 24}, "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download it from the official website (https://www.python.org/downloads/). Choose the latest version of Python 3 for Windows, macOS, or Linux. During installation, make sure to check the box that says \"Add Python to PATH\" (for Windows) or ensure that the correct interpreter is selected during setup (for macOS and Linux).\n\n2. **Open a Text Editor**: Use any text editor like Notepad (for Windows), TextEdit (for macOS), or Visual Studio Code, Sublime Text, Atom, etc. for writing your Python code.\n\n3. **Write the Code**: Copy and paste the following line into your text editor:\n\n ```python\n print(\"Hello, World!\")\n ```\n\n4. **Save the File**: Save this file with a `.py` extension, such as `hello_world.py`. For example, if you're using Notepad on Windows, save it as `hello_world.py`.\n\n5. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from the Applications > Utilities folder or by searching for \"Terminal\" in Spotlight.\n\n6. **Navigate to Your File's Location**: Use the `cd` command (for Command Prompt on Windows) or `cd` followed by your file path (for Terminal on macOS and Linux). For instance, if you saved the file in the Desktop folder:\n\n ```\n cd Desktop\n ```\n\n7. **Run the Python Script**: Type `python hello_world.py` (for Command Prompt on Windows) or `python3 hello_world.py` (for Terminal on macOS and Linux), then press Enter. You should see the output \"Hello, World!\" displayed in your terminal window.\n\nThat's it! You've just run a simple Python program. This example demonstrates how to print text using the built-in `print()` function.", "pdl__timing": {"start_nanos": 1742139920097455000, "end_nanos": 1742139927794421000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download it from the official website (https://www.python.org/downloads/). Choose the latest version of Python 3 for Windows, macOS, or Linux. During installation, make sure to check the box that says \"Add Python to PATH\" (for Windows) or ensure that the correct interpreter is selected during setup (for macOS and Linux).\n\n2. **Open a Text Editor**: Use any text editor like Notepad (for Windows), TextEdit (for macOS), or Visual Studio Code, Sublime Text, Atom, etc. for writing your Python code.\n\n3. **Write the Code**: Copy and paste the following line into your text editor:\n\n ```python\n print(\"Hello, World!\")\n ```\n\n4. **Save the File**: Save this file with a `.py` extension, such as `hello_world.py`. For example, if you're using Notepad on Windows, save it as `hello_world.py`.\n\n5. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from the Applications > Utilities folder or by searching for \"Terminal\" in Spotlight.\n\n6. **Navigate to Your File's Location**: Use the `cd` command (for Command Prompt on Windows) or `cd` followed by your file path (for Terminal on macOS and Linux). For instance, if you saved the file in the Desktop folder:\n\n ```\n cd Desktop\n ```\n\n7. **Run the Python Script**: Type `python hello_world.py` (for Command Prompt on Windows) or `python3 hello_world.py` (for Terminal on macOS and Linux), then press Enter. You should see the output \"Hello, World!\" displayed in your terminal window.\n\nThat's it! You've just run a simple Python program. This example demonstrates how to print text using the built-in `print()` function.", "pdl__timing": {"start_nanos": 1742139920050477000, "end_nanos": 1742139927794557000, "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": "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": 1742167736750671000, "end_nanos": 1742167736751205000, "timezone": "EDT"}, "pdl__is_leaf": true}, {"kind": "model", "pdl__id": "text.1.model", "context": [{"role": "user", "content": "write a hello world example, and explain to me how to run it", "defsite": "text.0"}], "defs": {}, "platform": "litellm", "model": "ollama_chat/granite3.2:2b", "input": "${ pdl_context }", "pdl__usage": {"completion_tokens": 458, "prompt_tokens": 24}, "pdl__result": "Sure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download it from the official website (https://www.python.org/downloads/). Choose the latest version of Python 3 for Windows, macOS, or Linux. During installation, make sure to check the box that says \"Add Python to PATH\" (for Windows) or ensure that the correct interpreter is selected during setup (for macOS and Linux).\n\n2. **Open a Text Editor**: Use any text editor like Notepad (for Windows), TextEdit (for macOS), or Visual Studio Code, Sublime Text, Atom, etc. for writing your Python code.\n\n3. **Write the Code**: Copy and paste the following line into your text editor:\n\n ```python\n print(\"Hello, World!\")\n ```\n\n4. **Save the File**: Save this file with a `.py` extension, such as `hello_world.py`. For example, if you're using Notepad on Windows, save it as `hello_world.py`.\n\n5. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from the Applications > Utilities folder or by searching for \"Terminal\" in Spotlight.\n\n6. **Navigate to Your File's Location**: Use the `cd` command (for Command Prompt on Windows) or `cd` followed by your file path (for Terminal on macOS and Linux). For instance, if you saved the file in the Desktop folder:\n\n ```\n cd Desktop\n ```\n\n7. **Run the Python Script**: Type `python hello_world.py` (for Command Prompt on Windows) or `python3 hello_world.py` (for Terminal on macOS and Linux), then press Enter. You should see the output \"Hello, World!\" displayed in your terminal window.\n\nThat's it! You've just run a simple Python program. This example demonstrates how to print text using the built-in `print()` function.", "pdl__timing": {"start_nanos": 1742167736802952000, "end_nanos": 1742167744651433000, "timezone": "EDT"}, "pdl__is_leaf": true}], "pdl__result": "write a hello world example, and explain to me how to run itSure, I'd be happy to help with that! Here's a simple \"Hello, World!\" program in Python, which is one of the most popular programming languages:\n\n```python\nprint(\"Hello, World!\")\n```\n\nTo run this code, follow these steps:\n\n1. **Install Python**: If you haven't already installed Python on your computer, download it from the official website (https://www.python.org/downloads/). Choose the latest version of Python 3 for Windows, macOS, or Linux. During installation, make sure to check the box that says \"Add Python to PATH\" (for Windows) or ensure that the correct interpreter is selected during setup (for macOS and Linux).\n\n2. **Open a Text Editor**: Use any text editor like Notepad (for Windows), TextEdit (for macOS), or Visual Studio Code, Sublime Text, Atom, etc. for writing your Python code.\n\n3. **Write the Code**: Copy and paste the following line into your text editor:\n\n ```python\n print(\"Hello, World!\")\n ```\n\n4. **Save the File**: Save this file with a `.py` extension, such as `hello_world.py`. For example, if you're using Notepad on Windows, save it as `hello_world.py`.\n\n5. **Open Command Prompt/Terminal**: On Windows, press `Win + R`, type `cmd`, and hit Enter. On macOS or Linux, open Terminal from the Applications > Utilities folder or by searching for \"Terminal\" in Spotlight.\n\n6. **Navigate to Your File's Location**: Use the `cd` command (for Command Prompt on Windows) or `cd` followed by your file path (for Terminal on macOS and Linux). For instance, if you saved the file in the Desktop folder:\n\n ```\n cd Desktop\n ```\n\n7. **Run the Python Script**: Type `python hello_world.py` (for Command Prompt on Windows) or `python3 hello_world.py` (for Terminal on macOS and Linux), then press Enter. You should see the output \"Hello, World!\" displayed in your terminal window.\n\nThat's it! You've just run a simple Python program. This example demonstrates how to print text using the built-in `print()` function.", "pdl__timing": {"start_nanos": 1742167736750625000, "end_nanos": 1742167744651487000, "timezone": "EDT"}, "pdl__is_leaf": false}

0 commit comments

Comments
 (0)