diff --git a/Python/flask/poetry.lock b/Python/flask/poetry.lock index 8fd33a8a..d82eacaf 100644 --- a/Python/flask/poetry.lock +++ b/Python/flask/poetry.lock @@ -24,13 +24,13 @@ trio = ["trio (>=0.23)"] [[package]] name = "autoblocksai" -version = "0.0.27" +version = "0.0.28" description = "Python client for Autoblocks" optional = false python-versions = ">=3.8.1,<4.0.0" files = [ - {file = "autoblocksai-0.0.27-py3-none-any.whl", hash = "sha256:6fb8976d957503d9ff757c7f224f4fd27ef14b0a69e5456afaa4a513bd5523db"}, - {file = "autoblocksai-0.0.27.tar.gz", hash = "sha256:d31fe964e5a5105d10913a30664a2b356073a7483addf1e23df3902683ddb78e"}, + {file = "autoblocksai-0.0.28-py3-none-any.whl", hash = "sha256:93c4f91e4bdb3ca2bde1ef7b4b49f42bae9d60f32c679de8d1465fd9aa35ce20"}, + {file = "autoblocksai-0.0.28.tar.gz", hash = "sha256:e711213b6aba28fdd7ed3846fa3dd91a3f6f880fc276ffacb427ec963ff4a2ac"}, ] [package.dependencies] @@ -496,4 +496,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "ee96dcc3e76fb49767e97c981123d4dc4a37925e8d1bd36fc59ba2c19e1f2326" +content-hash = "bcbef04ea99a28471701558b729a0b85e5601d938733d80b6a1611490f69213a" diff --git a/Python/flask/pyproject.toml b/Python/flask/pyproject.toml index f0fc862c..b05523a4 100644 --- a/Python/flask/pyproject.toml +++ b/Python/flask/pyproject.toml @@ -9,6 +9,6 @@ packages = [{include = "myapp"}] [tool.poetry.dependencies] python = "^3.9" -autoblocksai = "^0.0.27" +autoblocksai = "^0.0.28" python-dotenv = "^1.0.0" flask = "^3.0.0" diff --git a/Python/openai-tracing/poetry.lock b/Python/openai-tracing/poetry.lock index 4354482e..3b871d10 100644 --- a/Python/openai-tracing/poetry.lock +++ b/Python/openai-tracing/poetry.lock @@ -34,13 +34,13 @@ trio = ["trio (<0.22)"] [[package]] name = "autoblocksai" -version = "0.0.27" +version = "0.0.28" description = "Python client for Autoblocks" optional = false python-versions = ">=3.8.1,<4.0.0" files = [ - {file = "autoblocksai-0.0.27-py3-none-any.whl", hash = "sha256:6fb8976d957503d9ff757c7f224f4fd27ef14b0a69e5456afaa4a513bd5523db"}, - {file = "autoblocksai-0.0.27.tar.gz", hash = "sha256:d31fe964e5a5105d10913a30664a2b356073a7483addf1e23df3902683ddb78e"}, + {file = "autoblocksai-0.0.28-py3-none-any.whl", hash = "sha256:93c4f91e4bdb3ca2bde1ef7b4b49f42bae9d60f32c679de8d1465fd9aa35ce20"}, + {file = "autoblocksai-0.0.28.tar.gz", hash = "sha256:e711213b6aba28fdd7ed3846fa3dd91a3f6f880fc276ffacb427ec963ff4a2ac"}, ] [package.dependencies] @@ -514,4 +514,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "0a97e417b197eb91893f251943db3db7d0bd7f603a7af1d2f7bb27f8ee567c91" +content-hash = "fcea717d094b5355e1d425a856449210ed222851b367a79cc2a0d0478b2aae27" diff --git a/Python/openai-tracing/pyproject.toml b/Python/openai-tracing/pyproject.toml index b373e5a1..d072b558 100644 --- a/Python/openai-tracing/pyproject.toml +++ b/Python/openai-tracing/pyproject.toml @@ -10,7 +10,7 @@ packages = [{include = "src"}] [tool.poetry.dependencies] python = "^3.9" openai = "^1.0.0" -autoblocksai = "^0.0.27" +autoblocksai = "^0.0.28" python-dotenv = "^1.0.0" [tool.poetry.scripts] diff --git a/Python/openai-tracing/src/main.py b/Python/openai-tracing/src/main.py index d44f7824..d293e545 100644 --- a/Python/openai-tracing/src/main.py +++ b/Python/openai-tracing/src/main.py @@ -5,7 +5,6 @@ import dotenv from autoblocks.tracer import AutoblocksTracer -from autoblocks.vendor.openai import serialize_completion from openai import OpenAI dotenv.load_dotenv(".env") @@ -47,7 +46,9 @@ def main(): "ai.response", span_id=span_id, properties=dict( - response=serialize_completion(completion), + # OpenAI v1 returns pydantic models, which have a model_dump_json + # method for converting to JSON. + response=completion.model_dump_json(), latency=(time.time() - start_time) * 1000, ), ) diff --git a/Python/prompt-sdk-headless/poetry.lock b/Python/prompt-sdk-headless/poetry.lock index a1a447d2..2a0bb9f3 100644 --- a/Python/prompt-sdk-headless/poetry.lock +++ b/Python/prompt-sdk-headless/poetry.lock @@ -34,13 +34,13 @@ trio = ["trio (<0.22)"] [[package]] name = "autoblocksai" -version = "0.0.27" +version = "0.0.28" description = "Python client for Autoblocks" optional = false python-versions = ">=3.8.1,<4.0.0" files = [ - {file = "autoblocksai-0.0.27-py3-none-any.whl", hash = "sha256:6fb8976d957503d9ff757c7f224f4fd27ef14b0a69e5456afaa4a513bd5523db"}, - {file = "autoblocksai-0.0.27.tar.gz", hash = "sha256:d31fe964e5a5105d10913a30664a2b356073a7483addf1e23df3902683ddb78e"}, + {file = "autoblocksai-0.0.28-py3-none-any.whl", hash = "sha256:93c4f91e4bdb3ca2bde1ef7b4b49f42bae9d60f32c679de8d1465fd9aa35ce20"}, + {file = "autoblocksai-0.0.28.tar.gz", hash = "sha256:e711213b6aba28fdd7ed3846fa3dd91a3f6f880fc276ffacb427ec963ff4a2ac"}, ] [package.dependencies] @@ -487,4 +487,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "7e06d5e8cf459b9aac3de4633a4965ad945d25c3a002174cf1344078923133dd" +content-hash = "4322123fce15622aa5a5b8e5a0a2cf5fd387bd67445861948c4d6a7e245e9f09" diff --git a/Python/prompt-sdk-headless/pyproject.toml b/Python/prompt-sdk-headless/pyproject.toml index 1e732613..12e80758 100644 --- a/Python/prompt-sdk-headless/pyproject.toml +++ b/Python/prompt-sdk-headless/pyproject.toml @@ -10,7 +10,7 @@ packages = [{include = "src"}] [tool.poetry.dependencies] python = "^3.9" openai = "^1.0.0" -autoblocksai = "0.0.27" +autoblocksai = "0.0.28" python-dotenv = "^1.0.0" pydantic = "^2.5.3" diff --git a/Python/prompt-sdk-headless/src/main.py b/Python/prompt-sdk-headless/src/main.py index 8174a089..a15ac056 100644 --- a/Python/prompt-sdk-headless/src/main.py +++ b/Python/prompt-sdk-headless/src/main.py @@ -2,7 +2,6 @@ import dotenv from autoblocks.tracer import AutoblocksTracer -from autoblocks.vendor.openai import serialize_completion from openai import OpenAI from src.prompts import TextSummarizationMinorVersion @@ -56,7 +55,9 @@ def main(): tracer.send_event( "ai.response", properties=dict( - response=serialize_completion(response), + # OpenAI v1 returns pydantic models, which have a model_dump_json + # method for converting to JSON. + response=response.model_dump_json(), promptTracking=prompt.track(), ), )