jrmccluskey commented on code in PR #41196:
URL: https://github.com/apache/beam/pull/41196#discussion_r4540294760


##########
sdks/python/apache_beam/ml/inference/anthropic_inference.py:
##########
@@ -116,6 +116,7 @@ def message_from_string(
     inference_args: additional arguments passed to the messages.create call.
       Common args include 'max_tokens', 'system', 'temperature', 'top_p'.
   """
+  inference_args = dict(inference_args)
   max_tokens = inference_args.pop('max_tokens', 1024)

Review Comment:
   No reason to do this extra bit of work copying the dict on every invocation.
   
   ```suggestion
     max_tokens = inference_args.get('max_tokens', 1024)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to