-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加了对于本地Ollama模型的支持选项与基于中国国家气象局的天气接口 #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢大佬 PR!
base/func_weather.py
Outdated
url = 'http://t.weather.sojson.com/api/weather/city/' | ||
|
||
# 读取json文件 | ||
f = open('C:\\Users\\PengHeng\\Documents\\#appCode\\Python\\WeChatRobot\\base\\city.json', 'rb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
路径这样写死了,其他用户基本上就会遇到找不到文件。
另外,自己维护一张映射表还是比较累的,现在只有400多个城市,很容易就有人来问为什么查不到xxx城市的天气。
建议找一个接口来管理。
robot.py
Outdated
rsp = "梅好事助手正在通知人工处理" | ||
elif "天气" in msg.content: # 如果消息中含有"天气",则不使用ChatGPT | ||
rsp = "梅好事助手查询到芜湖天气为:\n" + get_weather("芜湖") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里建议助手名称一般化,不同用户可能需要不同的助手名。
就以上由于我个人疏忽造成的问题: 路径写死这个确实是忘记改为相对路径了(
配置助手名称
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, ship~
本地Ollama模型支持
添加了 base/func_ollama.py 文件实现具体功能
修改了robot.py 添加实现
天气接口
添加了 base/func_weather.py 实现具体功能
添加了 base/city.json 为接口实现自动城市码的查找