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"

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

相关推荐
Csvn3 小时前
一个请求等 60 秒?分层超时 + 指数退避,让 LLM 调用扛得住抖动(A01)
人工智能·aigc·agent
挖掘狂人4 小时前
为什么我们很难做出和英伟达媲美的 AI 芯片?
人工智能·芯片
AAA修煤气灶刘哥4 小时前
权重已经读进缓存了,7B 模型怎么还要等 43 秒?
人工智能·性能优化·阿里巴巴
oil欧哟4 小时前
AI Agent 的高效上下文工程:核心原理与实战拆解
人工智能
邂逅and回眸4 小时前
机器人的软件栈:ROS 2、实时中间件与数据流
人工智能·中间件·机器人
AAA修煤气灶刘哥4 小时前
AI 写的 SQL 跑通了,为什么和财务报表对不上?
人工智能·后端·算法
程序员cxuan5 小时前
这 6 个 Gemini 命令,真给我用爽了
人工智能·后端·程序员
狂师5 小时前
别只会用 Playwright、Appium了?这 8 款开源 AI 自动化工具实测推荐!
人工智能·开源·测试
东坡肘子6 小时前
我的代码我做主 -- 肘子的 Swift 周报 #164
人工智能·swiftui·swift
yyzc1111115 小时前
当中小微实体店面临经营困境时如何借助顺成汇创旗下荟生意品牌实现数字化智慧营销
大数据·运维·人工智能