Spatio.Api.Models (spatio_sdk v0.0.2)

API calls for all endpoints tagged Models.

Summary

Functions

Delete a model (admin-only).

Get the active model for a given provider.

List every LLM model the platform knows about.

Set a model as the active default for its provider (admin-only).

Functions

create_model(connection, request_body, opts \\ [])

@spec create_model(Tesla.Env.client(), %{optional(String.t()) => any()}, keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Register a model (admin-only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

delete_model(connection, id, opts \\ [])

@spec delete_model(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Delete a model (admin-only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

get_active_model(connection, opts \\ [])

@spec get_active_model(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Get the active model for a given provider.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :provider (String.t):

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

get_model(connection, id, opts \\ [])

@spec get_model(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch a model.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

list_models(connection, opts \\ [])

@spec list_models(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List every LLM model the platform knows about.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

set_active_model(connection, id, opts \\ [])

@spec set_active_model(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Set a model as the active default for its provider (admin-only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

update_model(connection, id, request_body, opts \\ [])

@spec update_model(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Update a model (admin-only).

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure