Class: Anthropic::Resources::Beta::Skills::Versions

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/skills/versions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Versions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Versions.

Parameters:



147
148
149
# File 'lib/anthropic/resources/beta/skills/versions.rb', line 147

def initialize(client:)
  @client = client
end

Instance Method Details

#create(skill_id, files: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Skills::VersionCreateResponse

Some parameter documentations has been truncated, see Models::Beta::Skills::VersionCreateParams for more details.

Create Skill Version

Parameters:

  • skill_id (String)

    Path param: Unique identifier for the skill.

  • files (Array<Pathname, StringIO, IO, String, Anthropic::FilePart>, nil)

    Body param: Files to upload for the skill.

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/anthropic/resources/beta/skills/versions.rb', line 26

def create(skill_id, params = {})
  parsed, options = Anthropic::Beta::Skills::VersionCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta"}
  @client.request(
    method: :post,
    path: ["v1/skills/%1$s/versions?beta=true", skill_id],
    headers: {
      "content-type" => "multipart/form-data",
      **parsed.slice(*header_params.keys)
    }.transform_keys(
      header_params
    ),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Models::Beta::Skills::VersionCreateResponse,
    options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
  )
end

#delete(version, skill_id: , betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Skills::VersionDeleteResponse

Some parameter documentations has been truncated, see Models::Beta::Skills::VersionDeleteParams for more details.

Delete Skill Version

Parameters:

  • version (String)

    Path param: Version identifier for the skill.

  • skill_id (String)

    Path param: Unique identifier for the skill.

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/anthropic/resources/beta/skills/versions.rb', line 129

def delete(version, params)
  parsed, options = Anthropic::Beta::Skills::VersionDeleteParams.dump_request(params)
  skill_id =
    parsed.delete(:skill_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["v1/skills/%1$s/versions/%2$s?beta=true", skill_id, version],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Models::Beta::Skills::VersionDeleteResponse,
    options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
  )
end

#list(skill_id, limit: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::Skills::VersionListResponse>

Some parameter documentations has been truncated, see Models::Beta::Skills::VersionListParams for more details.

List Skill Versions

Parameters:

  • skill_id (String)

    Path param: Unique identifier for the skill.

  • limit (Integer, nil)

    Query param: Number of items to return per page.

  • page (String, nil)

    Query param: Optionally set to the ‘next_page` token from the previous response.

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/anthropic/resources/beta/skills/versions.rb', line 97

def list(skill_id, params = {})
  parsed, options = Anthropic::Beta::Skills::VersionListParams.dump_request(params)
  query_params = [:limit, :page]
  @client.request(
    method: :get,
    path: ["v1/skills/%1$s/versions?beta=true", skill_id],
    query: parsed.slice(*query_params),
    headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Models::Beta::Skills::VersionListResponse,
    options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
  )
end

#retrieve(version, skill_id: , betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::Skills::VersionRetrieveResponse

Some parameter documentations has been truncated, see Models::Beta::Skills::VersionRetrieveParams for more details.

Get Skill Version

Parameters:

  • version (String)

    Path param: Version identifier for the skill.

  • skill_id (String)

    Path param: Unique identifier for the skill.

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/anthropic/resources/beta/skills/versions.rb', line 62

def retrieve(version, params)
  parsed, options = Anthropic::Beta::Skills::VersionRetrieveParams.dump_request(params)
  skill_id =
    parsed.delete(:skill_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/skills/%1$s/versions/%2$s?beta=true", skill_id, version],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Models::Beta::Skills::VersionRetrieveResponse,
    options: {extra_headers: {"anthropic-beta" => "skills-2025-10-02"}, **options}
  )
end