Skip to content

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

Description

@dabowman

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 ExcerptSuggestionsProviderEndpoint_Excerpt_GeneratorSuggestions_API_Service as output_config.language.
  • Title Suggestions adopts identically if /suggest-headline gets the field.

Roughly a day including tests.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01EbBmy5Tswq6og5uf2h24e1

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementTicket that requests an enhancement to an existing featurewp-parselyRequired label for all issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions