Class: Telnyx::Resources::AI::Missions::Runs::TelnyxAgents
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Missions::Runs::TelnyxAgents
- Defined in:
- lib/telnyx/resources/ai/missions/runs/telnyx_agents.rb,
sig/telnyx/resources/ai/missions/runs/telnyx_agents.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ TelnyxAgents
constructor
private
A new instance of TelnyxAgents.
-
#link(run_id, mission_id:, telnyx_agent_id:, request_options: {}) ⇒ Telnyx::Models::AI::Missions::Runs::TelnyxAgentLinkResponse
Link a Telnyx AI agent (voice/messaging) to a run.
-
#list(run_id, mission_id:, request_options: {}) ⇒ Telnyx::Models::AI::Missions::Runs::TelnyxAgentListResponse
Returns the Telnyx agents currently linked to the specified run.
-
#unlink(telnyx_agent_id, mission_id:, run_id:, request_options: {}) ⇒ nil
Unlinks the specified Telnyx agent from the run so it no longer participates in execution.
Constructor Details
#initialize(client:) ⇒ TelnyxAgents
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 TelnyxAgents.
104 105 106 |
# File 'lib/telnyx/resources/ai/missions/runs/telnyx_agents.rb', line 104 def initialize(client:) @client = client end |
Instance Method Details
#link(run_id, mission_id:, telnyx_agent_id:, request_options: {}) ⇒ Telnyx::Models::AI::Missions::Runs::TelnyxAgentLinkResponse
Link a Telnyx AI agent (voice/messaging) to a run
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/telnyx/resources/ai/missions/runs/telnyx_agents.rb', line 52 def link(run_id, params) parsed, = Telnyx::AI::Missions::Runs::TelnyxAgentLinkParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :post, path: ["ai/missions/%1$s/runs/%2$s/telnyx-agents", mission_id, run_id], body: parsed, model: Telnyx::Models::AI::Missions::Runs::TelnyxAgentLinkResponse, options: ) end |
#list(run_id, mission_id:, request_options: {}) ⇒ Telnyx::Models::AI::Missions::Runs::TelnyxAgentListResponse
Returns the Telnyx agents currently linked to the specified run. Linked agents participate in executing the run's plan.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/ai/missions/runs/telnyx_agents.rb', line 23 def list(run_id, params) parsed, = Telnyx::AI::Missions::Runs::TelnyxAgentListParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["ai/missions/%1$s/runs/%2$s/telnyx-agents", mission_id, run_id], model: Telnyx::Models::AI::Missions::Runs::TelnyxAgentListResponse, options: ) end |
#unlink(telnyx_agent_id, mission_id:, run_id:, request_options: {}) ⇒ nil
Unlinks the specified Telnyx agent from the run so it no longer participates in execution. The run itself and its history are unaffected.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/telnyx/resources/ai/missions/runs/telnyx_agents.rb', line 83 def unlink(telnyx_agent_id, params) parsed, = Telnyx::AI::Missions::Runs::TelnyxAgentUnlinkParams.dump_request(params) mission_id = parsed.delete(:mission_id) do raise ArgumentError.new("missing required path argument #{_1}") end run_id = parsed.delete(:run_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["ai/missions/%1$s/runs/%2$s/telnyx-agents/%3$s", mission_id, run_id, telnyx_agent_id], model: NilClass, options: ) end |