File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @botpress/zai" ,
33 "description" : " Zui AI (zai) – An LLM utility library written on top of Zui and the Botpress API" ,
4- "version" : " 2.5.5 " ,
4+ "version" : " 2.5.6 " ,
55 "main" : " ./dist/index.js" ,
66 "types" : " ./dist/index.d.ts" ,
77 "exports" : {
Original file line number Diff line number Diff line change @@ -125,7 +125,13 @@ const extract = async <S extends OfType<AnyObjectOrArray>>(
125125) : Promise < S [ '_output' ] > => {
126126 ctx . controller . signal . throwIfAborted ( )
127127
128- let schema = transforms . fromJSONSchema ( transforms . toJSONSchema ( _schema as any as z . ZodType ) )
128+ let schema : z . ZodType
129+ try {
130+ schema = transforms . fromJSONSchema ( transforms . toJSONSchema ( _schema as any as z . ZodType ) )
131+ } catch {
132+ // The above transformers arent the legacy once. They are very strict and might fail on some schema types.
133+ schema = _schema as any as z . ZodType
134+ }
129135
130136 const options = Options . parse ( _options ?? { } )
131137 const tokenizer = await getTokenizer ( )
You can’t perform that action at this time.
0 commit comments