Open ChristianWeyer opened 9 months ago
This is intriguing. Either you'd generate the schema from your data, or you'd just use string
and then add an additional validation call. I'm not sure the former is scalable.
I am not sure how either approach would help with my initial doubts... 🤔
You can just build a super TypeChat module that takes care of offering an updateable API and that then regenerates the schema and restarts the actual typechat process... The Schema does exactly what it is supposed to do -> Provide a schema for a response that needs to be adhered to.
Would you have a simple example that illustrates your approach @philkunz ?
It looks like this issue can be addressed by the new Zod integration. Here's an example: https://github.com/microsoft/TypeChat/blob/34f3fd7cc1585b694806ade2fa13ab1e4bc1acf1/examples/coffeeShop-zod/src/coffeeShopSchema.ts#L39
Hi all,
When looking at the samples like
CoffeeShop
orRestaurant
we can see schemas like:or
Here, we use data like the pizza names or the bakery products inside the schema definitions.
Is this a realistic approach? Usually, we have data from a data source/store, e.g., all the pizzas a restaurant offers. They won't/cannot live inside the schema definitions file in real life :-).
Do you have any thoughts on this design?
Thank you.