Class: Anthropic::Resources::Skills
- Inherits:
-
Object
- Object
- Anthropic::Resources::Skills
- Defined in:
- lib/anthropic/resources/skills.rb,
lib/anthropic/resources/skills/versions.rb,
sig/anthropic/resources/skills.rbs,
sig/anthropic/resources/skills/versions.rbs
Defined Under Namespace
Classes: Versions
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(files:, display_name: nil, request_options: {}) ⇒ Anthropic::Models::Skill
Create Skill.
-
#delete(skill_id, request_options: {}) ⇒ Anthropic::Models::DeletedSkill
Delete Skill.
-
#initialize(client:) ⇒ Skills
constructor
private
A new instance of Skills.
-
#list(limit: nil, page: nil, source: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Skill>
List Skills.
-
#retrieve(skill_id, request_options: {}) ⇒ Anthropic::Models::Skill
Get Skill.
Constructor Details
#initialize(client:) ⇒ Skills
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 Skills.
117 118 119 120 |
# File 'lib/anthropic/resources/skills.rb', line 117 def initialize(client:) @client = client @versions = Anthropic::Resources::Skills::Versions.new(client: client) end |
Instance Attribute Details
#versions ⇒ Anthropic::Resources::Skills::Versions (readonly)
7 8 9 |
# File 'lib/anthropic/resources/skills.rb', line 7 def versions @versions end |
Instance Method Details
#create(files:, display_name: nil, request_options: {}) ⇒ Anthropic::Models::Skill
Create Skill
Some parameter documentations has been truncated, see Models::SkillCreateParams for more details.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/anthropic/resources/skills.rb', line 25 def create(params) parsed, = Anthropic::SkillCreateParams.dump_request(params) @client.request( method: :post, path: "v1/skills", headers: {"content-type" => "multipart/form-data"}, body: parsed, model: Anthropic::Skill, options: ) end |
#delete(skill_id, request_options: {}) ⇒ Anthropic::Models::DeletedSkill
Delete Skill
Some parameter documentations has been truncated, see Models::SkillDeleteParams for more details.
105 106 107 108 109 110 111 112 |
# File 'lib/anthropic/resources/skills.rb', line 105 def delete(skill_id, params = {}) @client.request( method: :delete, path: ["v1/skills/%1$s", skill_id], model: Anthropic::DeletedSkill, options: params[:request_options] ) end |
#list(limit: nil, page: nil, source: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Skill>
List Skills
Some parameter documentations has been truncated, see Models::SkillListParams for more details.
78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/anthropic/resources/skills.rb', line 78 def list(params = {}) parsed, = Anthropic::SkillListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v1/skills", query: query, page: Anthropic::Internal::PageCursor, model: Anthropic::Skill, options: ) end |
#retrieve(skill_id, request_options: {}) ⇒ Anthropic::Models::Skill
Get Skill
Some parameter documentations has been truncated, see Models::SkillRetrieveParams for more details.
51 52 53 54 55 56 57 58 |
# File 'lib/anthropic/resources/skills.rb', line 51 def retrieve(skill_id, params = {}) @client.request( method: :get, path: ["v1/skills/%1$s", skill_id], model: Anthropic::Skill, options: params[:request_options] ) end |