microsoft / TypeChat

TypeChat is a library that makes it easy to build natural language interfaces using types.
https://microsoft.github.io/TypeChat/
MIT License
8.16k stars 390 forks source link

How to handle multiple languages? #132

Open rmtuckerphx opened 11 months ago

rmtuckerphx commented 11 months ago

From the restaurant example, we find this type in the schema:

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";
};

It appears that values in strings and comments (in English) are used to help construct the response JSON.

Would there need to be one schema file per language where all strings and comments are in a given language?