class Anthropic::RequestOptions
simply pass a Hash with symbol keys matching the attributes on this class.
When making a request, you can pass an actual {RequestOptions} instance, or
or override those provided at the client level.
Specify HTTP behaviour to use for a specific request. These options supplement
def self.validate!(opts)
-
(ArgumentError)
-
Parameters:
-
opts
(Anthropic::RequestOptions, Hash{Symbol=>Object}
) --
Other tags:
- Api: - private
def self.validate!(opts) case opts in Anthropic::RequestOptions | Hash opts.to_h.each_key do |k| unless fields.include?(k) raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") end end else raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") end end