让别的程序也能调用你的 Agent,得先把它封装成一个标准接口(API)。
定义清楚:别人怎么把问题发给你(请求格式)、你怎么把答案返回(响应格式)。通常是发一段 JSON、收一段 JSON。
为了体验好,回答最好「逐字蹦出来」(流式输出),而不是等全部生成完才显示。同时要处理好出错情况,给调用方明确的错误信息。
本节小结:封装成 API,你的 Agent 才能被网站、App 等各种程序使用。
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
Notify me of follow-up comments by email.
Notify me of new posts by email.
Leave a Reply