add-function-examples
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAdding Function Examples
新增功能示例
Review the changes in the current branch, and identify new or modified features or bug fixes that would benefit from having an example in the directory. These examples are used for testing specific features against the actual provider APIs, and can also serve as documentation for users.
examples/ai-functionsDetermine for which kind of model and top-level function the example should be added. For a language model, the example should be added in two variants, one for and one for . For any other models kinds, add the example for the relevant top-level function (e.g. , ).
generateTextstreamTextgenerateImagegenerateSpeechAfter creating the example, run ; fix any errors encountered.
pnpm type-check:full检查当前分支的变更,识别需要在目录下添加示例的新增/修改功能或bug修复。这些示例用于对接实际供应商API测试特定功能,同时也可作为用户的参考文档。
examples/ai-functions确定该示例应该对应哪种模型类型和顶层函数。如果是语言模型,需要添加两个版本的示例:一个适配,一个适配。对于其他任何类型的模型,为对应的相关顶层函数添加示例即可(例如、)。
generateTextstreamTextgenerateImagegenerateSpeech创建示例后,运行,修复遇到的所有错误。
pnpm type-check:full