Skip to content

Commit

Permalink
Handle null message content (#20)
Browse files Browse the repository at this point in the history
* Handle null message content

* fix: PR comment

* REMOVE extra parentheses

---------

Co-authored-by: ykriger-newrelic <97446848+ykriger-newrelic@users.noreply.github.com>
  • Loading branch information
RyanKadri and ykriger-newrelic authored Aug 30, 2023
1 parent 0100b4c commit 2bb4d96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nr_openai_observability/build_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def _build_messages_events(messages, completion_id, model):
for index, message in enumerate(messages):
currMessage = {
"id": str(uuid.uuid4()),
"content": message.get("content")[:4095],
"content": message.get("content", "")[:4095],
"role": message.get("role"),
"completion_id": completion_id,
"sequence": index,
Expand Down

0 comments on commit 2bb4d96

Please sign in to comment.