Skip to content

Commit f7f0ccf

Browse files
committed
Declare known stopReasons, as a kind of documentation
1 parent 099c2e2 commit f7f0ccf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ export const CreateMessageResultSchema = ResultSchema.extend({
868868
/**
869869
* The reason why sampling stopped.
870870
*/
871-
stopReason: z.optional(z.string()),
871+
stopReason: z.optional(z.enum(["endTurn", "stopSequence", "maxTokens"]).or(z.string())),
872872
role: z.enum(["user", "assistant"]),
873873
content: z.discriminatedUnion("type", [
874874
TextContentSchema,

0 commit comments

Comments
 (0)