From 9f3e21421cd55a9d890f61e14299687678f12e2a Mon Sep 17 00:00:00 2001 From: Jason Liu Date: Wed, 3 Jan 2024 18:55:21 -0500 Subject: [PATCH] fix example --- examples/extract_user/index.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/examples/extract_user/index.ts b/examples/extract_user/index.ts index 9d50bd43..46ed4d42 100644 --- a/examples/extract_user/index.ts +++ b/examples/extract_user/index.ts @@ -26,17 +26,10 @@ const user = await client.chat.completions.create({ model: "gpt-3.5-turbo", response_model: UserSchema, max_retries: 3 -}); - - -// let's now verify that the response type is inferred correctly - -const age: number = user.age; -// @ts-expect-error - age is a number, not a string -const _age: string = user.age; -const name: string = user.name; - -// @ts-expect-error - this property does not exist -user.missing; +}) console.log(user) +// { +// age: 30, +// name: "Jason Liu", +// }