Class: Oz::Resources::Identities

Inherits:
Base
  • Object
show all
Defined in:
lib/oz/resources/identities.rb

Overview

Manage agent identities (team-owned execution principals), reachable via client.agent.identities. These back the /agent/identities endpoints.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Oz::Resources::Base

Instance Method Details

#create(name:, **params) ⇒ Oz::Model

Create an agent identity.

Parameters:

  • name (String)

    a name for the agent

  • params (Hash)

    optional fields such as description, prompt, base_model, base_harness, environment_id, mcp_servers, memory_stores, secrets, skills, inference_providers, harness_auth_secrets

Returns:

  • (Oz::Model)

    the created identity (AgentResponse)



15
16
17
# File 'lib/oz/resources/identities.rb', line 15

def create(name:, **params)
  model(@client.post('/agent/identities', body: { name: name }.merge(params)))
end

#delete(uid) ⇒ nil

Delete an agent identity.

Returns:

  • (nil)


40
41
42
43
# File 'lib/oz/resources/identities.rb', line 40

def delete(uid)
  @client.delete("/agent/identities/#{enc(uid)}")
  nil
end

#listOz::Model

List all agent identities.

Returns:

  • (Oz::Model)

    response with an agents array



27
28
29
# File 'lib/oz/resources/identities.rb', line 27

def list
  model(@client.get('/agent/identities'))
end

#retrieve(uid) ⇒ Oz::Model Also known as: get

Retrieve a single agent identity by uid.

Returns:



33
34
35
# File 'lib/oz/resources/identities.rb', line 33

def retrieve(uid)
  model(@client.get("/agent/identities/#{enc(uid)}"))
end

#update(uid, **params) ⇒ Oz::Model

Update an agent identity. Accepts the same fields as #create.

Returns:



21
22
23
# File 'lib/oz/resources/identities.rb', line 21

def update(uid, **params)
  model(@client.put("/agent/identities/#{enc(uid)}", body: params))
end