Class: Conductor::Http::Api::PromptResourceApi
- Inherits:
-
Object
- Object
- Conductor::Http::Api::PromptResourceApi
- Defined in:
- lib/conductor/http/api/prompt_resource_api.rb
Overview
PromptResourceApi - API for prompt template management operations (Orkes)
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_prompt(name) ⇒ Object
Delete a prompt template.
-
#delete_tag_for_prompt_template(name, tags) ⇒ Object
Delete tags for a prompt template.
-
#get_prompt(name) ⇒ Object
Get a prompt template.
-
#get_prompts ⇒ Object
Get all prompt templates.
-
#get_tags_for_prompt_template(name) ⇒ Object
Get tags for a prompt template.
-
#initialize(api_client = nil) ⇒ PromptResourceApi
constructor
A new instance of PromptResourceApi.
-
#save_prompt(name, body, description: nil, models: nil, version: nil, auto_increment: false) ⇒ Object
Save a prompt template.
-
#test_prompt(body) ⇒ Object
Test a prompt template.
-
#update_tag_for_prompt_template(name, tags) ⇒ Object
Update tags for a prompt template.
Constructor Details
#initialize(api_client = nil) ⇒ PromptResourceApi
Returns a new instance of PromptResourceApi.
12 13 14 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 12 def initialize(api_client = nil) @api_client = api_client || ApiClient.new end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
10 11 12 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 10 def api_client @api_client end |
Instance Method Details
#delete_prompt(name) ⇒ Object
Delete a prompt template
52 53 54 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 52 def delete_prompt(name) @api_client.call_api('/prompts/{name}', 'DELETE', path_params: { name: name }, return_http_data_only: true) end |
#delete_tag_for_prompt_template(name, tags) ⇒ Object
Delete tags for a prompt template
69 70 71 72 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 69 def delete_tag_for_prompt_template(name, ) @api_client.call_api('/prompts/{name}/tags', 'DELETE', path_params: { name: name }, body: , return_http_data_only: true) end |
#get_prompt(name) ⇒ Object
Get a prompt template
41 42 43 44 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 41 def get_prompt(name) @api_client.call_api('/prompts/{name}', 'GET', path_params: { name: name }, return_type: 'PromptTemplate', return_http_data_only: true) end |
#get_prompts ⇒ Object
Get all prompt templates
47 48 49 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 47 def get_prompts @api_client.call_api('/prompts', 'GET', return_type: 'Array<PromptTemplate>', return_http_data_only: true) end |
#get_tags_for_prompt_template(name) ⇒ Object
Get tags for a prompt template
57 58 59 60 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 57 def (name) @api_client.call_api('/prompts/{name}/tags', 'GET', path_params: { name: name }, return_type: 'Array<TagObject>', return_http_data_only: true) end |
#save_prompt(name, body, description: nil, models: nil, version: nil, auto_increment: false) ⇒ Object
Save a prompt template
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 23 def save_prompt(name, body, description: nil, models: nil, version: nil, auto_increment: false) query = {} query[:description] = description if description query[:models] = models if models query[:version] = version if version query[:autoIncrement] = auto_increment if auto_increment @api_client.call_api( '/prompts/{name}', 'POST', path_params: { name: name }, query_params: query, body: body, return_http_data_only: true ) end |
#test_prompt(body) ⇒ Object
Test a prompt template
75 76 77 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 75 def test_prompt(body) @api_client.call_api('/prompts/test', 'POST', body: body, return_type: 'String', return_http_data_only: true) end |
#update_tag_for_prompt_template(name, tags) ⇒ Object
Update tags for a prompt template
63 64 65 66 |
# File 'lib/conductor/http/api/prompt_resource_api.rb', line 63 def update_tag_for_prompt_template(name, ) @api_client.call_api('/prompts/{name}/tags', 'PUT', path_params: { name: name }, body: , return_http_data_only: true) end |