3接上篇 我的自定义GPTs的改进优化 与物理世界连接成功 GPTs的创建与使用定义和执行特定任务的功能模块 通过API与外部系统或服务的交互

https://blog.csdn.net/chenhao0568/article/details/134875067?spm=1001.2014.3001.5502

从服务器日志里看到请求多了一个"location="

bash 复制代码
23.102.140.123 - - [08/Dec/2023:14:02:20 +0800] "GET /getWeather.php?location=&location=New+York HTTP/1.1" 200 337 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot"
65.154.226.167 - - [08/Dec/2023:14:06:31 +0800] "GET / HTTP/1.1" 403 548 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.132 Safari/537.36"
23.102.140.117 - - [08/Dec/2023:14:19:14 +0800] "GET /getWeather.php?location=&location=Beijing HTTP/1.1" 200 336 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot"

修改Schema

bash 复制代码
{
  "openapi": "3.1.0",
  "info": {
    "title": "Get weather data",
    "description": "Retrieves current weather data for a location.",
    "version": "v1.0.0"
  },
  "servers": [
    {
      "url": "https://3.wjsou.com"
    }
  ],
  "paths": {
    "/getWeather.php": {
      "get": {
        "description": "Get temperature for a specific location",
        "operationId": "GetCurrentWeather",
        "parameters": [
          {
            "name": "location",
            "in": "query",
            "description": "The city and state to retrieve the weather for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "deprecated": false
      }
    }
  },
  "components": {
    "schemas": {}
  }
}

再看服务器日志请求就对了。

bash 复制代码
23.102.140.117 - - [08/Dec/2023:14:37:32 +0800] "GET /getWeather.php?location=New+York HTTP/1.1" 200 337 "-" "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot"

首次输入英文后,后面输入中文北京也能理解了。

相关推荐
wenzhangli78 分钟前
30 分钟落地全栈交互:OneCode CLI+SVG 排课表实战
交互
Chat_zhanggong34515 分钟前
K4A8G165WC-BITD产品推荐
人工智能·嵌入式硬件·算法
霍格沃兹软件测试开发18 分钟前
Playwright MCP浏览器自动化指南:让AI精准理解你的命令
运维·人工智能·自动化
强化学习与机器人控制仿真23 分钟前
RSL-RL:开源人形机器人强化学习控制研究库
开发语言·人工智能·stm32·神经网络·机器人·强化学习·模仿学习
网易智企1 小时前
智能玩具新纪元:一个AI能力底座开启创新“加速度”
人工智能·microsoft
咚咚王者1 小时前
人工智能之数据分析 numpy:第十二章 数据持久化
人工智能·数据分析·numpy
沛沛老爹1 小时前
AI应用入门之LangChain中SerpAPI、LLM-Math等Tools的集成方法实践
人工智能·langchain·llm·ai入门·serpapi
roman_日积跬步-终至千里2 小时前
【强化学习基础(5)】策略搜索与学徒学习:从专家行为中学习加速学习过程
人工智能
杭州泽沃电子科技有限公司3 小时前
在线监测:为医药精细化工奠定安全、合规与质量基石
运维·人工智能·物联网·安全·智能监测
GIS数据转换器3 小时前
GIS+大模型助力安全风险精细化管理
大数据·网络·人工智能·安全·无人机