Class: Foobara::Ai::AnthropicApi::GetModel

Inherits:
BaseCommand show all
Includes:
CachedCommand
Defined in:
foobara-anthropic-api-1.1.0/src/get_model.rb

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Method Summary collapse

Methods inherited from BaseCommand

#anthropic_version, #api_token, #api_token_from_env, #build_request_headers, #issue_http_request

Methods inherited from Command

install!

Methods included from CommandPatternImplementation

install_state_machine_callback_methods

Methods included from TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Method Details

#build_result ⇒ Object



23
24
25
26
27
# File 'src/get_model.rb', line 23

def build_result
  Types::Model.new(response_body,
                   # Set this to false to discover new attributes
                   ignore_unexpected_attributes: true)
end

#foobara_cache_key ⇒ Object



11
12
13
# File 'src/get_model.rb', line 11

def foobara_cache_key
  @foobara_cache_key ||= [Util.underscore(self.class.name), model].join("-")
end