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
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, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Create an AI agent for a sender.
-
#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, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Update an AI agent’s configuration.
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.
169 170 171 172 173 174 175 |
# File 'lib/zavudev/resources/senders/agent.rb', line 169 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, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Create an AI agent for a sender. Each sender can have at most one agent.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/zavudev/resources/senders/agent.rb', line 52 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.
138 139 140 141 142 143 144 145 |
# File 'lib/zavudev/resources/senders/agent.rb', line 138 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.
73 74 75 76 77 78 79 80 |
# File 'lib/zavudev/resources/senders/agent.rb', line 73 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.
157 158 159 160 161 162 163 164 |
# File 'lib/zavudev/resources/senders/agent.rb', line 157 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, request_options: {}) ⇒ Zavudev::Models::Senders::AgentResponse
Update an AI agent’s configuration.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/zavudev/resources/senders/agent.rb', line 117 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 |