Class: Zavudev::Resources::AgentTemplates

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/agent_templates.rb,
sig/zavudev/resources/agent_templates.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AgentTemplates

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 AgentTemplates.

Parameters:



51
52
53
# File 'lib/zavudev/resources/agent_templates.rb', line 51

def initialize(client:)
  @client = client
end

Instance Method Details

#list(request_options: {}) ⇒ Zavudev::Models::AgentTemplateListResponse

List the factory agents available to scaffold with npx zavudev agents pull. Each entry is a ready-made voice or text agent (system prompt, skills, and — for voice agents — a co-located voice config).

Parameters:

Returns:

See Also:



39
40
41
42
43
44
45
46
# File 'lib/zavudev/resources/agent_templates.rb', line 39

def list(params = {})
  @client.request(
    method: :get,
    path: "v1/agent-templates",
    model: Zavudev::Models::AgentTemplateListResponse,
    options: params[:request_options]
  )
end

#retrieve(template_id, request_options: {}) ⇒ Zavudev::Models::AgentTemplateRetrieveResponse

Fetch a single factory agent fully rendered: the function files to scaffold (an index.ts that declares the agent with defineAgent and its skills with defineTool) plus the secrets it needs. This is what npx zavudev agents pull <id> writes to disk before npx zavudev deploy.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/zavudev/resources/agent_templates.rb', line 19

def retrieve(template_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/agent-templates/%1$s", template_id],
    model: Zavudev::Models::AgentTemplateRetrieveResponse,
    options: params[:request_options]
  )
end