-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Completers as a first class option in Prompts #1474
Copy link
Copy link
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedneeds decisionIssue is actionable, needs maintainer decision on whether to implementIssue is actionable, needs maintainer decision on whether to implement
One thought for a potential follow-up: now that the SDK is moving to schema-library-agnostic types, the
completable()API could be simplified to decouple it from Zod entirely.Instead of embedding completion callbacks inside schema objects (which requires Zod-specific introspection to extract), completers could be passed explicitly in the prompt config:
The type simplifies too, since completion values are always strings over the wire:
This PR already does most of the internal plumbing —
RegisteredPromptstorescompleters?: Map<string, CompleteCallback>. The remaining step would be accepting them in the config directly, which would let us deprecatecompletable(),extractCompleters, and the Zod-specific helpers (getZodSchemaShape,unwrapZodOptionalSchema, etc.).Not suggesting this as a blocker for this PR — just flagging as a natural follow-up that would complete the schema-agnostic story.
Originally posted by @felixweinberger in #1473 (comment)