知识卡片
端点数据契约需要语义校验
请求和响应模型规定字段及类型,仍需定义缺失、空值和互斥条件。若同时允许text与embedding,要规定至少一个、两者同时给时如何处理,并校验维度和版本;声明字段不表示处理函数已使用它。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
The endpoint function receives a Request object and uses it to construct a Response object. The app.post decorator takes care of all the HTTP POST protocol processing to convert the request payload (JSON string or bytes) into a Python Request object that your function can process just like any other Python object. The endpoint decorator also takes care of serializing the returned Response object to
参考来源
- 位置:《Natural Language Processing in Action, Second Edition》附录E《附录E:容器化微服务部署》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/appendix-e.html)
- 结论依据:摘录中关于端点数据契约需要语义校验的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:The endpoint function receives a Request object and uses it to construct a Response object. The app.post decorator takes care of all the HTTP POST protocol processing to convert the request payload (JSON string or bytes) into a Python Request object that your function can process just like any other Python object. The endpoint decorator also takes care of serializing the returned Response object to