Class: Appydave::Tools::YoutubeAutomation::GptAgent
- Inherits:
-
Object
- Object
- Appydave::Tools::YoutubeAutomation::GptAgent
- Includes:
- Configuration::Configurable
- Defined in:
- lib/appydave/tools/youtube_automation/gpt_agent.rb
Overview
GPT Agent interacts with OpenAI’s GPT API to generate responses based on prompts for YouTube automation.
Instance Method Summary collapse
-
#initialize(sequence, debug: false) ⇒ GptAgent
constructor
A new instance of GptAgent.
- #run ⇒ Object
Methods included from Configuration::Configurable
Constructor Details
#initialize(sequence, debug: false) ⇒ GptAgent
Returns a new instance of GptAgent.
10 11 12 13 14 |
# File 'lib/appydave/tools/youtube_automation/gpt_agent.rb', line 10 def initialize(sequence, debug: false) @sequence = sequence @debug = debug @prompts_path = '/Users/davidcruwys/Library/CloudStorage/Dropbox/team-tldr/_common/raw_prompts' end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/appydave/tools/youtube_automation/gpt_agent.rb', line 16 def run step = config.youtube_automation.get_sequence(@sequence) unless step puts "Error: Step #{@sequence} not found in the configuration." exit 1 end prompt_content = read_prompt(step) puts "Running sequence: #{@sequence}" puts "Prompt file: #{prompt_file}" puts "Prompt content:\n#{prompt_content}" if @debug response = run_prompt(prompt_content) puts "Response:\n#{response}" save_response(prompt_file, response) end |