Skip to content

Commit 6290b03

Browse files
committed
fill out Schema builder
1 parent 45e0afe commit 6290b03

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/vertexai/src/requests/schema-builder.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,15 @@ export class StringSchema extends Schema {
211211
}
212212
return obj as SchemaRequest;
213213
}
214+
215+
toJSON(): Record<string, unknown> {
216+
const obj = super.toJSON();
217+
if (this.enumValues) {
218+
obj['enum'] = this.enumValues;
219+
delete obj.enumValues;
220+
}
221+
return obj;
222+
}
214223
}
215224

216225
/**

0 commit comments

Comments
 (0)