Class: Zavudev::Resources::Senders::Agent
- Inherits:
-
Object
- Object
- Zavudev::Resources::Senders::Agent
- Defined in:
- lib/zavudev/resources/senders/agent.rb,
lib/zavudev/resources/senders/agent/flows.rb,
lib/zavudev/resources/senders/agent/tools.rb,
lib/zavudev/resources/senders/agent/executions.rb,
lib/zavudev/resources/senders/agent/knowledge_bases.rb,
lib/zavudev/resources/senders/agent/knowledge_bases/documents.rb,
sig/zavudev/resources/senders/agent.rbs,
sig/zavudev/resources/senders/agent/flows.rbs,
sig/zavudev/resources/senders/agent/tools.rbs,
sig/zavudev/resources/senders/agent/executions.rbs,
sig/zavudev/resources/senders/agent/knowledge_bases.rbs,
sig/zavudev/resources/senders/agent/knowledge_bases/documents.rbs
Defined Under Namespace
Classes: Executions, Flows, KnowledgeBases, Tools
Instance Attribute Summary collapse
- #executions ⇒ Zavudev::Resources::Senders::Agent::Executions readonly
- #flows ⇒ Zavudev::Resources::Senders::Agent::Flows readonly
- #knowledge_bases ⇒ Zavudev::Resources::Senders::Agent::KnowledgeBases readonly
- #tools ⇒ Zavudev::Resources::Senders::Agent::Tools readonly
Instance Method Summary collapse
-
#create(sender_id, model:, name:, provider:, system_prompt:, api_key: nil, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Some parameter documentations has been truncated, see Models::Senders::AgentCreateParams for more details.
-
#delete(sender_id, request_options: {}) ⇒ nil
Delete an AI agent.
-
#initialize(client:) ⇒ Agent
constructor
private
A new instance of Agent.
-
#retrieve(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Get the AI agent configuration for a sender.
-
#stats(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::AgentStats
Get statistics for an AI agent including invocations, tokens, and costs.
-
#update(sender_id, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Some parameter documentations has been truncated, see Models::Senders::AgentUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Agent
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 Agent.
185 186 187 188 189 190 191 |
# File 'lib/zavudev/resources/senders/agent.rb', line 185 def initialize(client:) @client = client @executions = Zavudev::Resources::Senders::Agent::Executions.new(client: client) @flows = Zavudev::Resources::Senders::Agent::Flows.new(client: client) @tools = Zavudev::Resources::Senders::Agent::Tools.new(client: client) @knowledge_bases = Zavudev::Resources::Senders::Agent::KnowledgeBases.new(client: client) end |
Instance Attribute Details
#executions ⇒ Zavudev::Resources::Senders::Agent::Executions (readonly)
8 9 10 |
# File 'lib/zavudev/resources/senders/agent.rb', line 8 def executions @executions end |
#flows ⇒ Zavudev::Resources::Senders::Agent::Flows (readonly)
11 12 13 |
# File 'lib/zavudev/resources/senders/agent.rb', line 11 def flows @flows end |
#knowledge_bases ⇒ Zavudev::Resources::Senders::Agent::KnowledgeBases (readonly)
17 18 19 |
# File 'lib/zavudev/resources/senders/agent.rb', line 17 def knowledge_bases @knowledge_bases end |
#tools ⇒ Zavudev::Resources::Senders::Agent::Tools (readonly)
14 15 16 |
# File 'lib/zavudev/resources/senders/agent.rb', line 14 def tools @tools end |
Instance Method Details
#create(sender_id, model:, name:, provider:, system_prompt:, api_key: nil, context_window_messages: nil, include_contact_metadata: nil, max_tokens: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Some parameter documentations has been truncated, see Models::Senders::AgentCreateParams for more details.
Create an AI agent for a sender. Each sender can have at most one agent.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/zavudev/resources/senders/agent.rb', line 57 def create(sender_id, params) parsed, = Zavudev::Senders::AgentCreateParams.dump_request(params) @client.request( method: :post, path: ["v1/senders/%1$s/agent", sender_id], body: parsed, model: Zavudev::Senders::AgentResponse, options: ) end |
#delete(sender_id, request_options: {}) ⇒ nil
Delete an AI agent.
148 149 150 151 152 153 154 155 |
# File 'lib/zavudev/resources/senders/agent.rb', line 148 def delete(sender_id, params = {}) @client.request( method: :delete, path: ["v1/senders/%1$s/agent", sender_id], model: NilClass, options: params[:request_options] ) end |
#retrieve(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Get the AI agent configuration for a sender.
78 79 80 81 82 83 84 85 |
# File 'lib/zavudev/resources/senders/agent.rb', line 78 def retrieve(sender_id, params = {}) @client.request( method: :get, path: ["v1/senders/%1$s/agent", sender_id], model: Zavudev::Senders::AgentResponse, options: params[:request_options] ) end |
#stats(sender_id, request_options: {}) ⇒ Zavudev::Models::Senders::AgentStats
Get statistics for an AI agent including invocations, tokens, and costs.
Covers the messaging channels only. Voice calls are not counted here: a call is
a multi-turn conversation rather than one inbound message and one reply, so it
is recorded as a call, not an execution. An agent that only answers phone calls
reports zeros on every field. Use GET /v1/calls for voice activity, duration,
and cost.
173 174 175 176 177 178 179 180 |
# File 'lib/zavudev/resources/senders/agent.rb', line 173 def stats(sender_id, params = {}) @client.request( method: :get, path: ["v1/senders/%1$s/agent/stats", sender_id], model: Zavudev::Senders::AgentStats, options: params[:request_options] ) end |
#update(sender_id, api_key: nil, context_window_messages: nil, enabled: nil, include_contact_metadata: nil, max_tokens: nil, model: nil, name: nil, provider: nil, system_prompt: nil, temperature: nil, trigger_on_channels: nil, trigger_on_message_types: nil, voice: nil, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Some parameter documentations has been truncated, see Models::Senders::AgentUpdateParams for more details.
Update an AI agent's configuration.
127 128 129 130 131 132 133 134 135 136 |
# File 'lib/zavudev/resources/senders/agent.rb', line 127 def update(sender_id, params = {}) parsed, = Zavudev::Senders::AgentUpdateParams.dump_request(params) @client.request( method: :patch, path: ["v1/senders/%1$s/agent", sender_id], body: parsed, model: Zavudev::Senders::AgentResponse, options: ) end |