Cloudflare.WorkersAiFinetune (Cloudflare v0.5.0)

Copy Markdown View Source

Workers AI Finetune

Create a new Finetune

POST /accounts/{account_id}/ai/finetunes

Responses

200 Returns the created finetune

Data is at body["result"]

{
  "created_at": "*string*",
  "description": "*string*",
  "id": "*string*",
  "model": "*string*",
  "modified_at": "*string*",
  "name": "*string*",
  "public": "*boolean*"
}
400 Finetune creation failed
{
  "errors": [
    {}
  ],
  "success": "*boolean*"
}

List Finetunes

GET /accounts/{account_id}/ai/finetunes

Responses

200 Returns all finetunes

Data is at body["result"]

{
  "created_at": "*string*",
  "description": "*string*",
  "id": "*string*",
  "model": "*string*",
  "modified_at": "*string*",
  "name": "*string*"
}
400 Bad Request
{
  "errors": [
    {
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

List Public Finetunes

GET /accounts/{account_id}/ai/finetunes/public

Responses

200 Returns all public finetunes

Data is at body["result"]

[
  {
    "created_at": "*string*",
    "description": "*string*",
    "id": "*string*",
    "model": "*string*",
    "modified_at": "*string*",
    "name": "*string*",
    "public": "*boolean*"
  }
]
400 Bad Request
{
  "errors": [
    {
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Upload a Finetune Asset

POST /accounts/{account_id}/ai/finetunes/{finetune_id}/finetune-assets

Responses

200 Returns successfully if finetunes were uploaded

Data is at body["result"]

{
  "success": "*boolean*"
}
400 Finetune creation failed
{
  "errors": [
    {}
  ],
  "success": "*boolean*"
}

Summary

Functions

client(opts \\ [])

create(body, opts \\ [])

@spec create(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  {:ok, map()} | {:error, term()}

create!(body, opts \\ [])

@spec create!(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  map() | no_return()

index(opts \\ [])

@spec index(opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

index!(opts \\ [])

@spec index!(opts :: Restlax.Resource.action_options()) :: map() | no_return()

path_for(id, opts \\ [])

@spec path_for(term(), [{:action, String.t()}]) :: String.t()

public(opts \\ [])

upload_asset(finetune_id, body, opts \\ [])