getter steps are:
- 1. If either [=this=]'s [=AISummarizerCapabilities/available create options=] or [=this=]'s [=AISummarizerCapabilities/available languages=] [=map/is empty|are empty=], then return "{{AICapabilityAvailability/no}}".
+ 1. If [=this=]'s [=AISummarizerCapabilities/available languages=] [=map/is empty|are empty=], then return "{{AICapabilityAvailability/no}}".
+
+ 1. If [=this=]'s all of [=this=]'s [=AISummarizerCapabilities/available create options=] [=map/values=] are "{{AICapabilityAvailability/no}}", then return "{{AICapabilityAvailability/no}}".
1. If all of [=this=]'s [=AISummarizerCapabilities/available create options=]'s [=map/values=] or all of [=this=]'s [=AISummarizerCapabilities/available languages=]'s [=map/values=] are "{{AICapabilityAvailability/after-download}}", then return "{{AICapabilityAvailability/after-download}}".
@@ -346,15 +392,15 @@ Every {{AISummarizerCapabilities}} has an
av
The
languageAvailable(|languageTag|) method steps are:
- 1. Return [=this=]'s [=AISummarizerCapabilities/available languages=][|languageTag|].
+ 1. Return [=this=]'s [=AISummarizerCapabilities/available languages=][|languageTag|], or "{{AICapabilityAvailability/no}}" if no such [=map/entry=] [=map/exists=].
-
Per WICG/translation-api#11 it seems we're supposed to do something more complex than just straight string comparison here, but it's not clear what.
+
Per WICG/translation-api#11 it seems we're supposed to do something more complex than just straight string comparison for language tags, but it's not clear what.
- The current summarizer capability value, given a {{AISummarizerType}} |type|, {{AISummarizerFormat}} |format|, and an {{AISummarizerLength}} |length|, is the return value of the following steps:
+ The current summarizer create options availability, given a {{AISummarizerType}} |type|, {{AISummarizerFormat}} |format|, and an {{AISummarizerLength}} |length|, is given by the following steps. They return an {{AICapabilityAvailability}} value or null.
1. [=Assert=]: this algorithm is running [=in parallel=].
@@ -362,9 +408,35 @@ Every {{AISummarizerCapabilities}} has an av
1. If the user agent believes it can summarize text according to |type|, |format|, and |length|, but only after performing a download (e.g., of an AI model or fine-tuning), then return "{{AICapabilityAvailability/after-download}}".
+ 1. If there is some error attempting to determine whether the user agent supports summarizing text, which the user agent believes to be transient (such that re-querying the [=current summarizer create options availability=] could stop producing such an error), then return null.
+
1. Otherwise, return "{{AICapabilityAvailability/no}}".
+
+ The current summarizer language availability map is given by the following steps. They return a [=map=] from strings representing BCP 47 language tags to {{AICapabilityAvailability}} values, or null. [[!RFC5646]]
+
+ 1. [=Assert=]: this algorithm is running [=in parallel=].
+
+ 1. If there is some error attempting to determine whether the user agent supports summarizing text, which the user agent believes to be transient (such that re-querying the [=current summarizer create options availability=] could stop producing such an error), then return null.
+
+ 1. Let |availableLanguages| be an empty [=map=].
+
+ 1. [=list/For each=] human language for which the user agent supports summarizing text written in that language, without performing any downloading operations:
+
+ 1. Let |languageTag| be that language, represented as a BCP 47 language tag string. Describe how to handle subtags.
+
+ 1. Set |availableLanguages|[|languageTag|] to "{{AICapabilityAvailability/readily}}".
+
+ 1. [=list/For each=] human language for which the user agent believes it can summarize text written in that language, but only after performing a download (e.g., of an AI model or fine-tuning):
+
+ 1. Let |languageTag| be that language, represented as a BCP 47 language tag string. Describe how to handle subtags.
+
+ 1. Set |availableLanguages|[|languageTag|] to "{{AICapabilityAvailability/after-download}}".
+
+ 1. Return |availableLanguages|.
+
+
Summarization
Every {{AISummarizer}} has a shared context, a [=string=], set during creation.