Class: Retell::SDK::Unofficial::API::RetellLLM
- Inherits:
-
Object
- Object
- Retell::SDK::Unofficial::API::RetellLLM
- Defined in:
- lib/retell/sdk/unofficial/api/retell_llm.rb
Instance Method Summary collapse
- #create(begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
- #delete(llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
-
#initialize(client) ⇒ RetellLLM
constructor
A new instance of RetellLLM.
- #list(extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
- #retrieve(llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
- #update(llm_or_id, begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ RetellLLM
Returns a new instance of RetellLLM.
6 7 8 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#create(begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 10 def create( begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) validate_model(model) if model validate_model_temperature(model_temperature) if model_temperature validate_general_tools(general_tools) if general_tools validate_states(states) if states payload = { begin_message: , general_prompt: general_prompt, general_tools: general_tools, inbound_dynamic_variables_webhook_url: inbound_dynamic_variables_webhook_url, model: model, model_temperature: model_temperature, starting_state: starting_state, states: states }.compact = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.post('/create-retell-llm', payload, **) end |
#delete(llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 130 def delete( llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) llm_id = llm_or_id.is_a?(Retell::SDK::Unofficial::RetellLLM) ? llm_or_id.llm_id : llm_or_id validate_non_empty_string(llm_id, 'llm_id') = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.delete("/delete-retell-llm/#{llm_id}", **) nil end |
#list(extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 114 def list( extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.get('/list-retell-llms', **) end |
#retrieve(llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 50 def retrieve( llm_or_id, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) llm_id = llm_or_id.is_a?(Retell::SDK::Unofficial::RetellLLM) ? llm_or_id.llm_id : llm_or_id validate_non_empty_string(llm_id, 'llm_id') = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.get("/get-retell-llm/#{llm_id}", **) end |
#update(llm_or_id, begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/retell/sdk/unofficial/api/retell_llm.rb', line 70 def update( llm_or_id, begin_message: nil, general_prompt: nil, general_tools: nil, inbound_dynamic_variables_webhook_url: nil, model: nil, model_temperature: nil, starting_state: nil, states: nil, extra_headers: nil, extra_query: nil, extra_body: nil, timeout: nil ) llm_id = llm_or_id.is_a?(Retell::SDK::Unofficial::RetellLLM) ? llm_or_id.llm_id : llm_or_id validate_non_empty_string(llm_id, 'llm_id') validate_model(model) if model validate_model_temperature(model_temperature) if model_temperature validate_general_tools(general_tools) if general_tools validate_states(states) if states payload = { begin_message: , general_prompt: general_prompt, general_tools: general_tools, inbound_dynamic_variables_webhook_url: inbound_dynamic_variables_webhook_url, model: model, model_temperature: model_temperature, starting_state: starting_state, states: states }.compact = @client.( extra_headers: extra_headers, extra_query: extra_query, extra_body: extra_body, timeout: timeout ) @client.patch("/update-retell-llm/#{llm_id}", payload, **) end |