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 Anthropic 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_temperature(0.1)
  .with_params(generationConfig: { maxOutputTokens: 8000 })
  .with_instructions(system_prompt)
  .ask(numbered_text)
polished_text = response.content