Class: VeniceClient::ModelsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/venice_client/api/models_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ModelsApi

Returns a new instance of ModelsApi.



16
17
18
# File 'lib/venice_client/api/models_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/venice_client/api/models_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#list_model_compatibility_mapping(opts = {}) ⇒ InlineResponse2006

/api/v1/models/compatibility_mapping Returns a list of model compatibility mappings and the associated model.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String) — default: default to text

Returns:



24
25
26
27
# File 'lib/venice_client/api/models_api.rb', line 24

def list_model_compatibility_mapping(opts = {})
  data, _status_code, _headers = list_model_compatibility_mapping_with_http_info(opts)
  data
end

#list_model_compatibility_mapping_with_http_info(opts = {}) ⇒ Array<(InlineResponse2006, Integer, Hash)>

/api/v1/models/compatibility_mapping Returns a list of model compatibility mappings and the associated model.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

Returns:

  • (Array<(InlineResponse2006, Integer, Hash)>)

    InlineResponse2006 data, response status code and response headers



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/venice_client/api/models_api.rb', line 34

def list_model_compatibility_mapping_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ModelsApi.list_model_compatibility_mapping ...'
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['embedding', 'image', 'text', 'tts', 'upscale'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of embedding, image, text, tts, upscale'
  end
  # resource path
  local_var_path = '/models/compatibility_mapping'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'InlineResponse2006' 

  auth_names = opts[:auth_names] || ['BearerAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ModelsApi#list_model_compatibility_mapping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_model_traits(opts = {}) ⇒ InlineResponse2005

/api/v1/models/traits Returns a list of model traits and the associated model.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String) — default: default to text

Returns:



80
81
82
83
# File 'lib/venice_client/api/models_api.rb', line 80

def list_model_traits(opts = {})
  data, _status_code, _headers = list_model_traits_with_http_info(opts)
  data
end

#list_model_traits_with_http_info(opts = {}) ⇒ Array<(InlineResponse2005, Integer, Hash)>

/api/v1/models/traits Returns a list of model traits and the associated model.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

Returns:

  • (Array<(InlineResponse2005, Integer, Hash)>)

    InlineResponse2005 data, response status code and response headers



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/venice_client/api/models_api.rb', line 90

def list_model_traits_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ModelsApi.list_model_traits ...'
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['embedding', 'image', 'text', 'tts', 'upscale'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of embedding, image, text, tts, upscale'
  end
  # resource path
  local_var_path = '/models/traits'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'InlineResponse2005' 

  auth_names = opts[:auth_names] || ['BearerAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ModelsApi#list_model_traits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_models(opts = {}) ⇒ InlineResponse2004

/api/v1/models Returns a list of available models supported by the Venice.ai API for both text and image inference.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



136
137
138
139
# File 'lib/venice_client/api/models_api.rb', line 136

def list_models(opts = {})
  data, _status_code, _headers = list_models_with_http_info(opts)
  data
end

#list_models_with_http_info(opts = {}) ⇒ Array<(InlineResponse2004, Integer, Hash)>

/api/v1/models Returns a list of available models supported by the Venice.ai API for both text and image inference.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(InlineResponse2004, Integer, Hash)>)

    InlineResponse2004 data, response status code and response headers



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/venice_client/api/models_api.rb', line 146

def list_models_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ModelsApi.list_models ...'
  end
  # resource path
  local_var_path = '/models'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'InlineResponse2004' 

  auth_names = opts[:auth_names] || ['BearerAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ModelsApi#list_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end