Class: Foobara::Ai::AnthropicApi::GetPageOfModels

Inherits:
BaseCommand show all
Defined in:
foobara-anthropic-api-1.0.5/src/foobara/ai/anthropic_api/get_page_of_models.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 TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Method Details

#build_request_bodyObject



17
18
19
20
21
22
23
24
25
# File 'src/foobara/ai/anthropic_api/get_page_of_models.rb', line 17

def build_request_body
  body = {}

  body[:before_id] = before_id if before_id
  body[:after_id] = after_id if after_id
  body[:limit] = limit if limit

  self.request_body = body
end

#build_resultObject



27
28
29
# File 'src/foobara/ai/anthropic_api/get_page_of_models.rb', line 27

def build_result
  Types::PageOfModels.new(response_body, ignore_unexpected_attributes: true)
end