diff --git a/lib/new_relic/agent/llm/chat_completion_message.rb b/lib/new_relic/agent/llm/chat_completion_message.rb index c678be9565..a60e654e55 100644 --- a/lib/new_relic/agent/llm/chat_completion_message.rb +++ b/lib/new_relic/agent/llm/chat_completion_message.rb @@ -6,7 +6,8 @@ module NewRelic module Agent module Llm class ChatCompletionMessage < LlmEvent - ATTRIBUTES = %i[content role sequence token_count is_response] + ATTRIBUTES = %i[content role sequence completion_id token_count + is_response] EVENT_NAME = 'LlmChatCompletionMessage' attr_accessor(*ATTRIBUTES) diff --git a/test/new_relic/agent/llm/chat_completion_message_test.rb b/test/new_relic/agent/llm/chat_completion_message_test.rb index 85eb809982..443a8d82f8 100644 --- a/test/new_relic/agent/llm/chat_completion_message_test.rb +++ b/test/new_relic/agent/llm/chat_completion_message_test.rb @@ -54,6 +54,7 @@ def test_record_creates_an_event message.response_model = 'gpt-4' message.vendor = 'OpenAI' message.role = 'system' + message.completion_id = 123 message.is_response = 'true' message.token_count = 10 @@ -73,6 +74,7 @@ def test_record_creates_an_event assert_equal 'Red-Tailed Hawk', attributes['content'] assert_equal 'system', attributes['role'] assert_equal 2, attributes['sequence'] + assert_equal 123, attributes['completion_id'] assert_equal 'true', attributes['is_response'] assert_equal 10, attributes['token_count'] end