microsoft / microsoft/TypeChat
TypeChat design question: Aren't we mixing schema and data?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.7k
- Forks
- 414
- Avg merge
- 3h 8m
- Merged PRs (30d)
- 3
Description
Hi all,
When looking at the samples like CoffeeShop or Restaurant we can see schemas like:
export interface BakeryProducts {
type: 'BakeryProducts';
name: 'apple bran muffin' | 'blueberry muffin' | 'lemon poppyseed muffin' | 'bagel';
options: (BakeryOptions | BakeryPreparations)[];
}
or
export type Pizza = {
itemType: 'pizza';
// default: large
size?: 'small' | 'medium' | 'large' | 'extra large';
// toppings requested (examples: pepperoni, arugula)
addedToppings?: string[];
// toppings requested to be removed (examples: fresh garlic, anchovies)
removedToppings?: string[];
// default: 1
quantity?: number;
// used if the requester references a pizza by name
name?: "Hawaiian" | "Yeti" | "Pig In a Forest" | "Cherry Bomb";
};
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the CoffeeShop and Restaurant samples and their TypeScript schema definitions, focusing on how values such as pizza names and bakery products are represented. The issue asks for design guidance rather than a specific change, so a useful outcome would first define whether external data sources should be supported and what the resulting schema or API behavior should be.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100