goldfishh / chatgpt-tool-hub

An open-source chatgpt tool ecosystem where you can combine tools with chatgpt and use natural language to do anything.
MIT License
1.2k stars 160 forks source link

使用meteo无法查询天气情况 #81

Open sky602816027 opened 10 months ago

sky602816027 commented 10 months ago

前置确认

1. 网络能够访问openai接口
2. git pull 拉取最新代码
3. 执行pip install -r requirements.txt,检查依赖是否满足
4. 在已有 issue 中未搜索到类似问题

5. 注意,提issue前请确认用本项目test.py(参考README.md 快速开始配置)重试一次你的问题是否能复现

问题描述

  1. 你的问题是否在test.py能复现?

  2. 你复现时的config.json,注意抹去你的api-key

    {
    "tools": [meteo-weather],
    "kwargs": {
      "debug": true  // debug模式一定要打开
      "no_default": true,
      "model_name": "gpt-4-1106-preview",
    }
    }
  3. 你的问题:

当我发送 "触发前缀 $tool 使用meteo查询今天深圳天气情况" 之后,无法返回给我天气情况
  1. 收到ai的回复:
嘿朋友!我超级理解你想要最新鲜的深圳天气预报的心情,但我告诉你个小秘密,现在的我还没有那个超酷的能力去使用外部工具或插件查天气呢.....
  1. debug模式终端打印的日志:
[INFO][2023-11-14 10:36:36][base.py:177] - 执行Tool: meteo-weather中...
[INFO][2023-11-14 10:36:36][base.py:115] - 输入: 深圳今天的天气情况 by day
[INFO][2023-11-14 10:36:36][tool_engine.py:134] - 我将给工具发送如下信息:
深圳今天的天气情况 by day
[INFO][2023-11-14 10:36:55][base.py:77] - URL 构造: 根据提供的API文档和问题要求,我们需要构建一个URL来获取深圳今天的天气情况,使用每日的天气数据。深圳的地理坐标大约是纬度22.5431°N,
经度114.0579°E。我们需要今天的日期,所以我们使用start_date和end_date参数,并且需要设置timezone参数,因为如果指定了每日天气变量,就需要这个参数。我们还需要包括最高温度、最低温度、总降
水量、最严重的天气状况、日出和日落时间、最大风速和最大阵风、以及主导风向。

当前时间是2023-11-14 10:36:36 UTC+8,所以今天的日期是2023-11-14。

构建的API URL如下:

https://api.open-meteo.com/v1/forecast?latitude=22.5431&longitude=114.0579&daily=temperature_2m_max,temperature_2m_min,precipitation_sum,weathercode,sunrise,sunset,windspeed_10m_max,w indgusts_10m_max,winddirection_10m_dominant&start_date=2023-11-14&end_date=2023-11-14&timezone=Asia/Shanghai

[ERROR][2023-11-14 10:36:55][victorinox.py:114] - [APP] catch a Exception: No connection adapters were found for '根据提供的API文档和问题要求,我们需要构建一个URL来获取深圳今天的天气
情况,使用每日的天气数据。深圳的地理坐标大约是纬度22.5431°N,经度114.0579°E。我们需要今天的日期,所以我们使用start_date和end_date参数,并且需要设置timezone参数,因为如果指定了每日天
气变量,就需要这个参数。我们还需要包括最高温度、最低温度、总降水量、最严重的天气状况、日出和日落时间、最大风速和最大阵风、以及主导风向。\n\n当前时间是2023-11-14 10:36:36 UTC+8,所以今
天的日期是2023-11-14。\n\n构建的API URL如下:\n\n```\nhttps://api.open-meteo.com/v1/forecast?latitude=22.5431&longitude=114.0579&daily=temperature_2m_max,temperature_2m_min,precipitat
ion_sum,weathercode,sunrise,sunset,windspeed_10m_max,windgusts_10m_max,winddirection_10m_dominant&start_date=2023-11-14&end_date=2023-11-14&timezone=Asia/Shanghai\n```'
[ERROR][2023-11-14 10:36:55][victorinox.py:117] - exceed retry_num
[ERROR][2023-11-14 10:36:55][tool.py:108] - 超过重试次数

环境