Skip to content

Commit

Permalink
Update ChatCompletionSummary attribute datatypes
Browse files Browse the repository at this point in the history
request_max_tokens should be an integer
request.temperature should be a float

This change ensures the correct datatype is assigned.
  • Loading branch information
kaylareopelle committed Mar 13, 2024
1 parent 41e521a commit b21f4e0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def chat_completions_instrumentation(parameters)
def create_chat_completion_summary(parameters)
NewRelic::Agent::Llm::ChatCompletionSummary.new(
vendor: VENDOR,
request_max_tokens: parameters[:max_tokens] || parameters['max_tokens'],
request_max_tokens: (parameters[:max_tokens] || parameters['max_tokens'])&.to_i,
request_model: parameters[:model] || parameters['model'],
temperature: parameters[:temperature] || parameters['temperature'],
temperature: (parameters[:temperature] || parameters['temperature'])&.to_f,
metadata: llm_custom_attributes
)
end
Expand Down

0 comments on commit b21f4e0

Please sign in to comment.