You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I tested the new streaming functionality, I found that when the parameters are not quite right it semi-silently fails:
3.3.0:044 > params=>{:model=>"claude-3-haiku-20240307",:temperature=>0.9,:max_tokens=>4096,:messages=>[{:role=>"user",:content=>"Some kind of preamble that doesn't have arguments.\n\nSample Script Contents 1\n\nAnother section yay\n\nSample Script Contents 1 and Input Item in Special Instruction\n\nThis section has a lot of lines\nIt is here to test the lines.\n\nLet's have some more text:\n\nThis will prevent RuboCop from checking the Sample Script Contents 2 syntax style throughout your entire codebase. Make sure to place this under the correct hierarchy in your .rubocop.yml file, typically at the root level or under a specific target if you have Sample Script Contents 1 configurations for different parts of your project."}],:stream=>true,:preprocess_stream=>:text}3.3.0:045 > @client.messages(parameters:params)=>{"type"=>"error","error"=>{"type"=>"invalid_request_error","message"=>"preprocess_stream: Extra inputs are not permitted"}}
I wonder if these kinds of errors (invalid requests in particular) should actually result in an Anthropic::Error being raised.
I can add this code if you think it makes sense.
The text was updated successfully, but these errors were encountered:
To be clear this would also happen with other weird mistakes like passing system: nil in the params, which is an easy mistake to make and not a bug in the anthropic gem like the preprocess_stream issue above (which is now fixed in the latest code in my fork).
As I tested the new streaming functionality, I found that when the parameters are not quite right it semi-silently fails:
I wonder if these kinds of errors (invalid requests in particular) should actually result in an
Anthropic::Error
being raised.I can add this code if you think it makes sense.
The text was updated successfully, but these errors were encountered: