Skip to content

Commit

Permalink
model_dump_json -> model_dump
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole White committed Mar 2, 2024
1 parent 6da2a64 commit 8e7b29f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Python/openai-tracing/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
Expand Down
4 changes: 2 additions & 2 deletions Python/prompt-sdk-headless/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
),
)

Expand Down

0 comments on commit 8e7b29f

Please sign in to comment.