Class: VideoProcessing::SeoAgent

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

Overview

RubyLLM Agent for generating SEO content from video transcripts.

Used by VideoProcessing::SeoService to produce structured SEO output
(sub_header, meta_title, meta_description, expanded_description) via Gemini
directly, bypassing the AssemblyAI LLM Gateway.

The service uses with_schema(VideoSeoSchema) to request structured output and
configures the model-compatible sampling/thinking options and output cap
from Settings at runtime.

Examples:

Generating SEO content

response = VideoProcessing::SeoAgent.chat
  .with_provider_options(generationConfig: {
    maxOutputTokens: max_tokens,
    thinkingConfig: { thinkingLevel: 'low' }
  })
  .with_schema(VideoSeoSchema)
  .ask(user_prompt)
parsed_content = response.content
parsed_content = JSON.parse(parsed_content) if parsed_content.is_a?(String)