You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, prompt is an async function that loads a prompt from the registry. This is in practice annoying because most of the time you want a prompt to be a high-level reference that is registered at the top level:
At the moment,
prompt
is an async function that loads a prompt from the registry. This is in practice annoying because most of the time you want a prompt to be a high-level reference that is registered at the top level:Since top-level await is bad, this desirable pattern is not currently possible.
Proposal: PromptRef
Instead of
prompt
async returning aDotprompt
class, it can instead return a memoizing proxy ref, something like:This way, a prompt reference can be loaded synchronously while still working exactly the same as the async version today in practice.
The text was updated successfully, but these errors were encountered: