写点什么

场景篇 -ChatGPT 帮我实现发送公众号推文

作者:小马哥
  • 2023-04-27
    四川
  • 本文字数:769 字

    阅读完需:约 3 分钟

场景篇-ChatGPT帮我实现发送公众号推文

项目地址: https://github.com/chatgpt-community/chatgpt-wechat-sender

Prompt 设计

i have one user story need your help.
User Story: US1description: i want create a python file "WechatSender.py", which can help me create wechat draft article and publish it.
Acceptance Criteria:
when system environment wechat_appid and wechat_secret is null, log error and throw error
when i invoke WechatSender.send(event), a wechat draft article should been created and published
when i invoke WechatSender.send(event), should log article id
tech solutions:
event contains title:String, subTitle:String, content:String
invoke wechat api steps should be
invoke https://api.weixin.qq.com/cgi-bin/token to get access_token
invoke https://api.weixin.qq.com/cgi-bin/draft/add?access_token={{access_token}} to add wechat draft article and get media_id from response
invoke https://api.weixin.qq.com/cgi-bin/freepublish/submit?access_token={{access_token}} to publish article by input media_id
if you understand above requirements please say yes. secondly visualize your understanding about US1 , last step implement "WechatSender.py" for me
复制代码

response from chatgpt



write tests for WechatSender.py



发现

  • 被 ChatGPT 教育



  • ChatGPT 可以修复失败的测试案例


结果:

能够跑通测试和发送公众号!



总结

  • chatgpt is good at single python file developing with clarified requirements.

  • chatgpt know some best practices for example library imports and unit tests.

  • chatgpt can complete almost 90% works. and left human can do 10% quick fix

so chatgpt can improve development efficiency.


用户头像

小马哥

关注

程序员、技术顾问、编程教练 2019-07-21 加入

ThoughtWorks Senior Consultant MentorFinder共创社区发起人 CGC ChatGPT社区发起人 爱豆创空间社区少儿编程社区发起人 ActNow ToastMaster国际演讲俱乐部主席

评论

发布
暂无评论
场景篇-ChatGPT帮我实现发送公众号推文_微信公众号_小马哥_InfoQ写作社区