Class: Conductor::Client::PromptClient

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/client/prompt_client.rb

Overview

PromptClient - High-level client for prompt template management operations (Orkes)

Instance Method Summary collapse

Constructor Details

#initialize(api_client) ⇒ PromptClient

Returns a new instance of PromptClient.



7
8
9
# File 'lib/conductor/client/prompt_client.rb', line 7

def initialize(api_client)
  @prompt_api = Http::Api::PromptResourceApi.new(api_client)
end

Instance Method Details

#delete_prompt(prompt_name) ⇒ Object



27
28
29
# File 'lib/conductor/client/prompt_client.rb', line 27

def delete_prompt(prompt_name)
  @prompt_api.delete_prompt(prompt_name)
end

#delete_tag_for_prompt_template(prompt_name, tags) ⇒ Object



39
40
41
# File 'lib/conductor/client/prompt_client.rb', line 39

def delete_tag_for_prompt_template(prompt_name, tags)
  @prompt_api.delete_tag_for_prompt_template(prompt_name, tags)
end

#get_prompt(prompt_name) ⇒ Object



19
20
21
# File 'lib/conductor/client/prompt_client.rb', line 19

def get_prompt(prompt_name)
  @prompt_api.get_prompt(prompt_name)
end

#get_promptsObject



23
24
25
# File 'lib/conductor/client/prompt_client.rb', line 23

def get_prompts
  @prompt_api.get_prompts
end

#get_tags_for_prompt_template(prompt_name) ⇒ Object



31
32
33
# File 'lib/conductor/client/prompt_client.rb', line 31

def get_tags_for_prompt_template(prompt_name)
  @prompt_api.get_tags_for_prompt_template(prompt_name)
end

#save_prompt(prompt_name, description, prompt_template, models: nil, version: nil, auto_increment: false) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/conductor/client/prompt_client.rb', line 11

def save_prompt(prompt_name, description, prompt_template, models: nil, version: nil, auto_increment: false)
  @prompt_api.save_prompt(
    prompt_name, prompt_template,
    description: description, models: models,
    version: version, auto_increment: auto_increment
  )
end

#test_prompt(prompt_text, variables, ai_integration, text_complete_model, temperature: 0.1, top_p: 0.9, stop_words: nil) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/conductor/client/prompt_client.rb', line 43

def test_prompt(prompt_text, variables, ai_integration, text_complete_model, temperature: 0.1, top_p: 0.9,
                stop_words: nil)
  request = Http::Models::PromptTemplateTestRequest.new(
    prompt: prompt_text,
    prompt_variables: variables,
    llm_provider: ai_integration,
    model: text_complete_model,
    temperature: temperature,
    top_p: top_p,
    stop_words: stop_words
  )
  @prompt_api.test_prompt(request)
end

#update_tag_for_prompt_template(prompt_name, tags) ⇒ Object



35
36
37
# File 'lib/conductor/client/prompt_client.rb', line 35

def update_tag_for_prompt_template(prompt_name, tags)
  @prompt_api.update_tag_for_prompt_template(prompt_name, tags)
end