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

Open
#4,490 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
openapi, php

Research direction

Start by reviewing the live suggestions-api OpenAPI spec and the named ExcerptSuggestionsProvider, Endpoint_Excerpt_Generator, and Suggestions_API_Service entry points. The work is currently blocked until the API accepts language; done would require that API support and the WP-side setting to thread output_config.language through excerpt generation, with corresponding tests.

Written by the indexing model from the issue text.

Description

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

Dominant language
PHP
Stars
67
Forks
38
Avg merge
1d 5h
Merged PRs (30d)
79

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Parsely/wp-parsely

All issues in Parsely/wp-parsely

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.