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 Anthropic
directly, bypassing the AssemblyAI LLM Gateway.

The service uses with_schema(VideoSeoSchema) to request structured output and
overrides temperature/maxOutputTokens from Settings at runtime.

Examples:

Generating SEO content

response = VideoProcessing::SeoAgent.chat
  .with_temperature(temperature)
  .with_params(generationConfig: { maxOutputTokens: max_tokens })
  .with_schema(VideoSeoSchema)
  .ask(user_prompt)
parsed_content = response.content
parsed_content = JSON.parse(parsed_content) if parsed_content.is_a?(String)