面向Google编程CHARLES ZHANG

AI DAILY / 2026-09-13

用GPT-6 Astra生成环家跑步路线

Generating running routes with GPT-6 Astra and ChatGPT Work

上下文与记忆Simon Willison · 2026-09-12

中文翻译 · AI 生成,仅供学习交流

用 GPT-6 Astra 和 ChatGPT Work 生成跑步路线

今天早上我让 ChatGPT Work 配合 GPT-6 Astra(Max)做了一件挺有意思的事:我住在 <我的地址>。请帮我规划从我这里出发的 5 公里和 10 公里环线跑步路线,数据使用 OSM(OpenStreetMap)。它运行了 27 分钟,正好产出了我要求的内容,包含一个嵌入式的可视化结果,以及可下载的 GPX(GPS 交换格式)文件和 GeoJSON(基于 JSON 的地理数据交换格式)文件。下面就是那条 5 公里的路线:

我问它是怎么生成这条路线的,它是这样回答的:

> 我先用 Nominatim(OSM 的地理编码服务)定位地址,再用 Overpass(OSM 的查询 API)下载本地的 OpenStreetMap 道路和路径数据,然后在本地计算出环线。

令人沮丧的是,它实际运行的代码以及具体操作的细节,我在 ChatGPT 界面里都看不到。在我看来,这种不透明的设计是一种反特性(译注:anti-feature,指表面上看像特性、实际上是缺陷的设计)。等我想到要让它把用过的 Python 代码给我一份时,ChatGPT 已经拿不出来了。这看起来是因为对话线程已经被压缩(compacted)了。我认为,任何使用压缩机制的 LLM(大语言模型)系统,都应当既保留压缩前的原文,又通过智能体(agent)的工具调用(tool calls)把这部分文本开放出来,以避免出现这类问题。

至于向我展示地图,用的是 visualize 这个技能(skill)。它生成了一个文件 /workspace/el-granada-5k-share.html,直接嵌入到 ChatGPT 界面里。下面就是这个 HTML 文件的开头部分:

< div id =" eg-share-loop " >
< div class =" viz-row " >
< h3 > El Granada harbor loop </ h3 >
< span class =" text-small " > 5.1 km </ span >
</ div >
< div id =" eg-share-stage " > </ div >
< div class =" text-small text-muted " > Map data © < a href =" https://www.openstreetmap.org/copyright " target =" _blank " rel =" noopener " > OpenStreetMap contributors </ a > </ div >
< style >
# eg-share-loop { width : 100 % ; }
# eg-share-loop # eg-share-stage { width : 100 % ; margin : 8 px 0 ; }
# eg-share-loop . eg-share-map { display : block; width : 100 % ; touch-action : none; }
# eg-share-loop . eg-share-map text { fill : var ( --foreground ); font-size : 12 px ; font-weight : 400 ; }
# eg-share-loop . eg-share-label { paint-order : stroke; stroke : var ( --background ); stroke-width : 3 px ; stroke-linejoin : round; }
</ style >
< script type =" application/json " id =" eg-share-data " > { "route" : { "type" : "LineString" , "coordinates" : [ [ - 122.467425 , 37.4997753 ] . . .
</ script >
< script src =" https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js " > </ script >
< script >
(() => {
  const root=document.getElementById('eg-share-loop');

那个 <script type="application/json"> 元素里包含了渲染跑步路线和地图所需的全部几何数据,使用的是 D3(Data-Driven Documents,一个数据驱动的文档可视化 JavaScript 库),从一份列入白名单的 CDN(内容分发网络)地址加载。这部分说明在 visualize 技能文档的下面这一节里:

> 外部资源
>
> CSP(内容安全策略)只允许 cdnjs.cloudflare.com、esm.sh、cdn.jsdelivr.net、unpkg.com、fonts.googleapis.com、fonts.gstatic.com 以及 fonts.bunny.net。其他来源会被拦截并静默失败。

标签:geospatial, ai, d3, openai, generative-ai, chatgpt, llms, skills, gpt-6-astra