0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

連載シリーズ生成: 目次ワンショット → 章別生成

0
Last updated at Posted at 2026-02-16

ブログ投稿システムの続き

現在

・ブログ9個を運用中
・投稿数 4記事/一日

課題

・記事がマンネリ化・・・

設計

核心: 目次記事がアンカー(全章で不変のフルテキストコンテキスト)。各章は目次+前章要約を受け取り、「第N章を書け」だけ指示 → LLMが考える。

既存の問題

WorkflowProcessingService.process_user_batch (L113-212) に既に連載検出ロジックがあるが:

  • SeriesPlanner が薄い計画JSON を先に作る → 今回消した ConceptDefiner と同じ問題
  • 各エピソードは独立実行 → 前章のコンテキストが引き継がれない

Proposed Changes

1. 目次記事の生成

[MODIFY] article_content_generator_task.py

_execute_remixseries_outline モード追加:

  • inputs.get("series_mode") == "outline" のとき、ソース記事群から目次記事を生成
  • 出力: title, content, series_outline_text(後続章に渡すフルテキスト), chapter_count

series_chapter モード追加:

  • inputs.get("series_mode") == "chapter" のとき
  • inputs: series_outline_text, chapter_number, previous_chapter_summary, total_chapters
  • プロンプト: 「以下の目次を参照し、第N章を書け」+ 前章要約

2. シリーズ連投の制御

[MODIFY] workflow_processing_service.py

既存の SeriesPlanner ベースのロジック (L113-212) を書き換え:

  1. 目次記事生成: remix workflow を series_mode: "outline" で実行 → 投稿
  2. 章ごとのループ: 投稿結果から series_outline_textchapter_count を取得し、N回ループ:
    • series_mode: "chapter", chapter_number: N, previous_chapter_summary を渡してremix workflow実行
    • 投稿後、記事本文から要約(300字)をLLMで抽出して previous_chapter_summary に格納
    • 次の章へ

3. ワークフローJSONの拡張

[MODIFY] stage2_remix_creation.json

generate_remix_content の inputs/outputs に series_mode, series_outline_text, chapter_number, previous_chapter_summary, total_chapters を追加。

[!IMPORTANT]
PostJob dataclass への変更は不要。シリーズのループは WorkflowProcessingService 内で完結する(ジョブキューを跨がない)。これは既存の連載ロジックと同じ設計。

Verification Plan

Automated Tests

  • python -c "import ast; ..." で構文チェック
  • JSON workflow のバリデーション

Manual Verification

  • #3部作 タグ付きLINEメッセージでシリーズ生成をトリガー
  • 目次記事 → 3章が連続投稿されることを確認
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?