From 8e7b29f959808460392c1671321c26d402356a46 Mon Sep 17 00:00:00 2001 From: Nicole White Date: Fri, 1 Mar 2024 19:51:51 -0500 Subject: [PATCH] model_dump_json -> model_dump --- Python/openai-tracing/src/main.py | 6 +++--- Python/prompt-sdk-headless/src/main.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Python/openai-tracing/src/main.py b/Python/openai-tracing/src/main.py index d293e545..600903ce 100644 --- a/Python/openai-tracing/src/main.py +++ b/Python/openai-tracing/src/main.py @@ -46,9 +46,9 @@ def main(): "ai.response", span_id=span_id, properties=dict( - # OpenAI v1 returns pydantic models, which have a model_dump_json - # method for converting to JSON. - response=completion.model_dump_json(), + # OpenAI v1 returns pydantic models, which have a model_dump + # method for converting to a dictionary. + response=completion.model_dump(), latency=(time.time() - start_time) * 1000, ), ) diff --git a/Python/prompt-sdk-headless/src/main.py b/Python/prompt-sdk-headless/src/main.py index e9d299e2..c59e1c15 100644 --- a/Python/prompt-sdk-headless/src/main.py +++ b/Python/prompt-sdk-headless/src/main.py @@ -56,9 +56,9 @@ def main(): "ai.response", prompt_tracking=prompt.track(), properties=dict( - # OpenAI v1 returns pydantic models, which have a model_dump_json + # OpenAI v1 returns pydantic models, which have a model_dump # method for converting to JSON. - response=response.model_dump_json(), + response=response.model_dump(), ), )