Excerpt Suggestions: add language option (blocked on Suggestions API language support)

オープン
#4,490 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
openapi, php

調査の方向性

まず、ライブの suggestions-api OpenAPI 仕様と、指定されているエントリーポイント ExcerptSuggestionsProvider、Endpoint_Excerpt_Generator、Suggestions_API_Service を確認します。現在、この作業は API が言語を受け付けるようになるまでブロックされています。完了には、その API サポートと、抜粋生成において output_config.language を引き渡す WP 側の設定、および対応するテストが必要です。

索引モデルが issue の本文から書いたものです。

説明

Enhancement wp-parsely

Feature request

Offer a language option in Excerpt Suggestions, matching Jetpack AI's excerpt generator: users writing in Spanish, French, German, etc. should be able to choose the output language of generated excerpts (and, later, titles).

Why this is currently blocked

Jetpack's language selector works because its backend (WPCOM jetpack-ai-query) builds the LLM prompt server-side from a context object that includes language. Our chain ends at Parse.ly's POST /suggest-brief, where the prompt is also constructed service-side — but the API has no language input:

  • Per the live OpenAPI spec (suggestions-api.parsely.com/openapi.json, checked 2026-08-06), output_config on /suggest-brief accepts only persona, style, max_items, max_characters.
  • No endpoint in the API accepts a language or locale parameter.
  • The API docs scope content listing to English-language post pages, so the service is English-centric by design today.

Shipping a language dropdown now would be a dead control — the field would be silently ignored. (Users can incidentally nudge language via the free-form 32-char persona/style strings, e.g. persona "French journalist", but that's not something to productize.)

Required API change (for the suggestions-api team)

Add an optional field to BriefOutputConfig (and ideally the /suggest-headline equivalent, for Title Suggestions parity):

"language": {
  "type": "string",
  "title": "Language",
  "description": "BCP 47 / ISO 639-1 code for the output language (e.g. 'en', 'fr', 'pt-BR'). When omitted, output matches the language of the input text.",
  "default": null
}

Server-side, inject the corresponding instruction during prompt construction. null/omitted preserves current behavior, so the change is backward-compatible for existing clients.

Open questions for the API team:

  1. What does the model do today with non-English input? If it already mirrors input language, the parameter's main value is cross-language generation and explicit pinning.
  2. Validation: enum of supported codes vs. free string? An enum in the OpenAPI spec would let clients build the picker from the schema.
  3. Does the "English-language post pages" data-access scope constrain only the discovery endpoints, or generation input too? Worth confirming and documenting.
  4. Any model-side quality concerns with persona/style values interacting with non-English output.

WP-side plan once the API ships

Small, mechanical change following the pattern established in #4489 for max_characters:

  • New persisted Length-style Language setting (default from site locale), rendered as a SelectControl in the excerpt settings popover (Jetpack's 12-language list is a reasonable template).
  • Threaded through ExcerptSuggestionsProvider → Endpoint_Excerpt_Generator → Suggestions_API_Service as output_config.language.
  • Title Suggestions adopts identically if /suggest-headline gets the field.

Roughly a day including tests.

Related

  • #4489 (Excerpt Suggestions redesign this would build on)

🤖 Generated with Claude Code

https://claude.ai/code/session_01EbBmy5Tswq6og5uf2h24e1

主要言語
PHP
スター
67
フォーク
38
平均マージ
1日 5時間
マージ済み PR(30日)
79

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Parsely/wp-parsely のほかの issue

Parsely/wp-parsely の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。