explainers-by-googlers / prompt-api

A proposal for a web API for prompting browser-provided language models
Creative Commons Attribution 4.0 International
226 stars 15 forks source link

Abort signal for `clone()` API #43

Closed lozy219 closed 4 weeks ago

lozy219 commented 4 weeks ago

Do we need an abort signal for the clone() API? We have one for the assistant creation API and the clone() should have a similar flow.

domenic commented 4 weeks ago

Yes, good idea! Let's do it. I'll update the explainer soon.

tomayac commented 4 weeks ago

(Reflected in https://github.com/DefinitelyTyped/DefinitelyTyped/pull/70688.)

lozy219 commented 3 weeks ago

Thanks for adding that into the explainer, but why does clone() API needs a dedicated AIAssistantCreateOptions while the prompt(), promptStreaming(), countPromptTokens() share the AIAssistantPromptOptions?

domenic commented 3 weeks ago

It is just future-proofing. There is no observable difference at the moment (when they have the same contents). In theory an implementation could consolidate all dictionaries which contain a single signal member into one dictionary, no matter what API they are from.