Class: VideoProcessing::PolishAgent

Inherits:
RubyLLM::Agent
  • Object
show all
Defined in:
app/agents/video_processing/polish_agent.rb

Overview

RubyLLM Agent for polishing video transcripts and captions.

Used by VideoProcessing::TranscriptionService to fix terminology, grammar,
and speech artifacts via Gemini directly, bypassing the AssemblyAI LLM
Gateway for non-transcription work.

The service provides the full system prompt at runtime via with_instructions,
since paragraph polishing embeds dynamic terminology lists and VTT polishing
uses Settings-based prompts.

Examples:

Polishing a batch of numbered paragraphs

response = VideoProcessing::PolishAgent.chat
  .with_provider_options(generationConfig: {
    maxOutputTokens: 8000,
    thinkingConfig: { thinkingLevel: 'low' }
  })
  .with_instructions(system_prompt)
  .ask(numbered_text)
polished_text = response.content