diff --git a/lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb b/lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb index 8b9aca9..1dba91a 100644 --- a/lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb +++ b/lib/braintrust/contrib/anthropic/instrumentation/beta_messages.rb @@ -169,8 +169,8 @@ def set_input(span, params) input_messages = [] begin - if params[:system] - system_content = params[:system] + if params[:system_] + system_content = params[:system_] if system_content.is_a?(Array) system_text = system_content.map { |blk| blk.is_a?(Hash) ? blk[:text] : blk diff --git a/lib/braintrust/contrib/anthropic/instrumentation/messages.rb b/lib/braintrust/contrib/anthropic/instrumentation/messages.rb index 5512c07..ab112fc 100644 --- a/lib/braintrust/contrib/anthropic/instrumentation/messages.rb +++ b/lib/braintrust/contrib/anthropic/instrumentation/messages.rb @@ -98,8 +98,8 @@ def build_metadata(params, stream: false) def set_input(span, params) input_messages = [] - if params[:system] - system_content = params[:system] + if params[:system_] + system_content = params[:system_] if system_content.is_a?(Array) system_text = system_content.map { |blk| blk.is_a?(Hash) ? blk[:text] : blk diff --git a/test/braintrust/contrib/anthropic/instrumentation/messages_test.rb b/test/braintrust/contrib/anthropic/instrumentation/messages_test.rb index 50e087b..12f09aa 100644 --- a/test/braintrust/contrib/anthropic/instrumentation/messages_test.rb +++ b/test/braintrust/contrib/anthropic/instrumentation/messages_test.rb @@ -130,7 +130,7 @@ def test_handles_system_prompt message = client.messages.create( model: "claude-sonnet-4-20250514", max_tokens: 20, - system: "You are a helpful assistant that always responds briefly.", + system_: "You are a helpful assistant that always responds briefly.", messages: [ {role: "user", content: "Say hello"} ]