拆解 MCP 的运行原理

注意: 此实验非常消耗模型 Token
背景: 最近 MCP 火的发烫,什么是 MCP 就不讨论了,比较好奇 MCP 具体的运行逻辑。
**现象:**同时使用 Cursor 和 MaxKB 对接腾讯地图的 MCP Server,发现返回的内容有较大差别。(和模型能力有较大关系)

Cursor 的返回结果,使用的是 Claude- 3.5:

MaxKB 的返回结果,此时使用的是阿里百炼的 qwen-turbo 模型:

实验目的:从大模型的角度拆解 MCP 的运行原理是什么,使用 CloudFlare 代理 AI 模型,看一下具体的调用链路,做过程记录。

具体原理:

注:MCP Client 在 Call 大模型的时候会提交大量包含工具使用等内容的提示词

实验步骤:

用到的工具:CloudFlare、OpenRouter、MaxKB、腾讯地图 MCP Server、Cursor

1、构建 Cloudflare AI Gateway

通过 CloudFlare 代理大模型,从而记录 API 调用

2、创建一个 OpenRouter 的 Platform

代理 OpenRouter

保管此 API Endpoint

3、注册 OpenRouter 并获取 Key

目的是免费使用合适的大模型

4、在 MaxKB 中添加 CloudFlare 代理的 AI 模型

用对接 OpenAI 的方式对接 通过 CloudFlare 代理的运行在 OpenRouter 上的 Claude。(这里有点绕,,,)

基础模型:在 OpenRouter 模型列表中的模型名称,此处选用 Cloude-3.5-sonnet

API URL:CloudFlare AI Gateway 的 API Endpoint

API Key:OpenRouter 上获取的 Key

5、注册腾讯地图服务并获取 Key

为什么选用腾讯地图的 MCP 服务?因为腾讯地图官方提供托管面部署的 MCP Server。

登录腾讯地图开发者平台,地址:https://lbs.qq.com/dev/console/home

创建应用并获取 Key

开启 API 配额,要不 API 无法调用

6、在MaxKB中添加腾讯地图 MCP Server

MCP Server 配置参考样例:

复制代码
{
  "tengxunditu": {
    "url": "https://mcp.map.qq.com/sse?key=xxxx-xxxx-xxxx-xxxx-xxxx-xxxx",
    "transport": "sse"
  }
}

详情参考官方手册:https://lbs.qq.com/service/MCPServer/MCPServerGuide/userGuide

7、在 MaxKB 的工作流中使用使用 MCP 方式调用

注:此时使用的是 Claude-3.5-sonnet ,效果和在 Cursor 上使用比较接近

8、查看 CloudFlare AI Gateway 的记录

如图是一个 MCP 任务的 API 调用及消耗,单次 MCP 执行约消耗 10W Tokens

log 太多,这里放一部分。

复制代码
请求:
{
  "messages": [
    {
      "content": "问题:\n帮我规划从深圳会展中心去深圳宝安机场的驾车路线,中途去深圳车公庙地铁站附近加个油",
      "role": "user"
    }
  ],
  "model": "anthropic/claude-3.5-sonnet",
  "max_completion_tokens": 800,
  "stream": true,
  "temperature": 0.7,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "geocoder",
        "description": "提供由文字地址(包含省市区信息的完整地址)到经纬度的转换能力,并同时提供结构化的省市区地址信息",
        "parameters": {
          "type": "object",
          "properties": {
            "address": {
              "description": "包含省市区信息的的格式化地址 或 包含城市名的地点关键词",
              "type": "string"
            }
          },
          "required": [
            "address"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "placeSuggestion",
        "description": "根据要搜索地点的关键词和搜索的城市(城市名),搜索符合条件的地点信息, 返回包括地点名称、地址、经纬度、分类等(如搜索北京的景点、酒店、购物场景,搜索某个地方的详细地址等)",
        "parameters": {
          "type": "object",
          "properties": {
            "keyword": {
              "description": "关键词,地点名称",
              "type": "string"
            },
            "region": {
              "description": "搜索城市,如果不知道城市名,可不输入本参数",
              "type": "string"
            }
          },
          "required": [
            "keyword"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "placeSearchNearby",
        "description": "附近周边搜索,输入的搜索关键词,中心点经纬度(格式lat,lng)搜索其周边符合条件的地点信息 返回包括地点名称、地址、经纬度、分类等(如搜索北京的景点、酒店、购物场景,搜索某个地方的详细地址等)",
        "parameters": {
          "type": "object",
          "properties": {
            "keyword": {
              "description": "关键词,地点名称",
              "type": "string"
            },
            "location": {
              "description": "搜索中心点经纬度(可以通过地址解析将文字地址转为经纬度),格式lat,lng",
              "type": "string"
            }
          },
          "required": [
            "location",
            "keyword"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "directionDriving",
        "description": "根据起终点经纬度,规划驾车路线,支持参考路况、少收费、不走高速等偏好,同时支持返回路线预估用时,路线距离,过路费等信息",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)经纬度,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "placeAlongby",
        "description": "在路线的沿途进行搜索:输入路线的经纬度坐标串和搜索关键词,搜索该路线沿途符合该关键词的地点,路线的经纬度点串,可以通过驾车路线规划获取",
        "parameters": {
          "type": "object",
          "properties": {
            "keyword": {
              "description": "搜索关键词,例如:充电站、厕所、停车场、购物、加油站、银行ATM、加气站、便利店、服务区、汽车维修、中石油、中石化",
              "type": "string"
            },
            "polyline": {
              "description": "经纬度点构成的折线,结构是lat1,lng1,lat2,lng2,lat3,lng4....",
              "type": "string"
            }
          },
          "required": [
            "polyline",
            "keyword"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "placeDetail",
        "description": "POI详情信息,根据POI ID搜索相关信息,包括:名称、地址、经纬度、分类、省市区信息。如果查询结果为空,则返回POI ID不存在",
        "parameters": {
          "type": "object",
          "properties": {
            "id": {
              "description": "poiid",
              "type": "string"
            }
          },
          "required": [
            "id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "matrix",
        "description": "用于批量计算多个起终点到多个终点的路面距离(或称导航距离)",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "mode": {
              "description": "通行方式,驾车为driving, 步行为walking, 骑行为bicycling。 不支持其他通行方式",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to",
            "mode"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "reverseGeocoder",
        "description": "输入经纬度坐标,返回其所在位置的语义化地址、省、市、区、乡镇、门牌号、行政区划代码、商圈、地标、道路及交叉口、河流、湖泊、桥等",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {
              "description": "经纬度坐标,结构是lat,lng",
              "type": "string"
            }
          },
          "required": [
            "location"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "ipLocation",
        "description": "通过终端设备IP地址获取其当前所在省、市、区信息。",
        "parameters": {
          "type": "object",
          "properties": {
            "ip": {
              "description": "IP地址(IPv4或IPv6)",
              "type": "string"
            }
          },
          "required": [
            "ip"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "weather",
        "description": "通过行政区划代码,查询对应城市的实时天气或预报天气。",
        "parameters": {
          "type": "object",
          "properties": {
            "adcode": {
              "description": "行政区划代码(可通过调用地址解析获取,输入地址或城市名,返回结果中的adcode即为行政区划代码)",
              "type": "string"
            },
            "type": {
              "description": "可选now或者future。用户查询当前天气为now,查询未来天气为future。可为空,默认为now。",
              "type": "string"
            }
          },
          "required": [
            "adcode"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "directionWalking",
        "description": "根据起终点经纬度,规划步行路线,返回包括路线总距离、预估用时等",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "directionBicycling",
        "description": "根据起终点经纬度,规划自行车骑行路线,返回包括路线总距离、预估用时等",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "directionTransit",
        "description": "公共交通路线规划,根据起终点经纬度,规划公交/地铁线路乘坐方案, 支持指定出发时间(确保线路在首末车时段内),支持时间短、少换乘、少步行、地铁优先等多种偏好,为您规划多组乘坐方案, 同时返回路线总预估用时、总距离、总步行距离、票价,具体线路如何换乘(线路名、上车站、下车站名等)、首末车时间等",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "futureDrivingDirection",
        "description": "根据起终点经纬度、未来出发时间,规划驾车驾车路线,路线会考虑未来时间的预测路况进行规划,支持返回预估用时、总距离等信息",
        "parameters": {
          "type": "object",
          "properties": {
            "departure_time": {
              "description": "出发时间(时间戳格式)",
              "type": "string"
            },
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to",
            "departure_time"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "waypointOrder",
        "description": "基于驾车路线规划,对输入的途经点以最顺路方式排序并规划路线,排序途经点最多16个。返回结果中的waypoints代表途经点的顺序",
        "parameters": {
          "type": "object",
          "properties": {
            "from": {
              "description": "起点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "need_waypoint_order": {
              "description": "如果waypoints不是空,则传true",
              "type": "string"
            },
            "to": {
              "description": "终点(目的地)点经纬度信息,结构是lat,lng。 如果输入的是包含省市区信息的完整地址,可以调用地址解析获取经纬度, 如果是地点名称,可调用地点搜索获取经纬度(返回多条结果时可取第1条)",
              "type": "string"
            },
            "waypoints": {
              "description": "途经点经纬度,支持最多16个,结构是lat1,lng1;lat2,lng2;lat3,lng3....如果输入的是地址,则需要调用geocoder获取经纬度信息",
              "type": "string"
            }
          },
          "required": [
            "from",
            "to"
          ]
        }
      }
    }
  ]
}
----------------------------------------------------------------------------------------------------------------------------------------------------
返回:
{
  "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
  "provider": "Amazon Bedrock",
  "model": "anthropic/claude-3.5-sonnet",
  "choices": [
    {
      "delta": {
        "role": "assistant",
        "content": "我来帮您规划这段行程。这需要分几步:\n1. 先获取各个地点的具体位置和经纬度\n2. 规划加油站的最佳途经顺序\n3. 查看行驶路线\n\n让我们一步步来:\n\n1. 首先获取这些地点的经纬度:"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 11944,
    "completion_tokens": 141,
    "total_tokens": 12085
  },
  "streamed_data": [
    {
      "nonce": "a3",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "9cf808bed3270cb4",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "我"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "c3",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "来"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "1a5a3a1e8349",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "帮您"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "949c",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "规划这"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "11c0",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "段"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "7049e8514f81",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "行"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "cf6f8026cc652491",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "程。这"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "6b479e3a",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "需"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "519a5460e5bba1a0",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "要分"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "05d1",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "几"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "3ee4",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "步:"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "f83b",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "\n1. 先"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "e6b55adf",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "获"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "3c284b",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "取各"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "5d39ab42",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "个"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "bdb5",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "地"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "260762bf77b7",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "点的具"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "2e",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "体位置和"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "c43992a3f65bb6d1",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "经"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "19afbefb65",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "纬度"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "0400bd6349573f1c",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "\n2. 规"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "75c3db90fa",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "划加"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "6e371898d0e502",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "油站的最"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "b95ae22b01",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "佳途"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "1978d5d7",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "经"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "c540e9faad8cf5",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "顺序"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "dd2671b8c9",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "\n3. 查"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "fb5fdb",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "看行"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "b73a29511e7c",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "驶路线"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "09fe",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "\n\n让"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "6e",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "我们一"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "2e3ef81cd56e71d6",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "步步"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "69791b866a94b420",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "来:"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "db",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "\n\n1. "
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "1d445b",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "首"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "0cf97e2eec",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "先获取这"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "3cc30c",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "些地点的"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "6319ca0a9d8ec971",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "经"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "f23555",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": "纬度:"
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "55460da8",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "51",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "id": "tooluse_NiqffqaITCmVtmoeIMkFNg",
                "index": 0,
                "type": "function",
                "function": {
                  "name": "geocoder",
                  "arguments": ""
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "1f",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "index": 0,
                "type": "function",
                "function": {
                  "arguments": ""
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "d180bed3",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "index": 0,
                "type": "function",
                "function": {
                  "arguments": "{\""
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "1def6ce090",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "index": 0,
                "type": "function",
                "function": {
                  "arguments": "ad"
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "75",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "index": 0,
                "type": "function",
                "function": {
                  "arguments": "dress\""
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "39b54669",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "delta": {
            "role": "assistant",
            "content": null,
            "tool_calls": [
              {
                "index": 0,
                "type": "function",
                "function": {
                  "arguments": ": \"深圳会展中心\"}"
                }
              }
            ]
          },
          "index": 0,
          "finish_reason": null,
          "native_finish_reason": null
        }
      ]
    },
    {
      "nonce": "4509",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "edb0917e",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": "tool_calls",
          "native_finish_reason": "tool_calls",
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "f8bb8536b4dc32",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ]
    },
    {
      "nonce": "7450c6b8a93ceb",
      "id": "gen-1744110839-tKMReVlveRBEHdEelZCW",
      "provider": "Amazon Bedrock",
      "model": "anthropic/claude-3.5-sonnet",
      "object": "chat.completion.chunk",
      "created": 1744110839,
      "choices": [
        {
          "index": 0,
          "delta": {
            "role": "assistant",
            "content": ""
          },
          "finish_reason": null,
          "native_finish_reason": null,
          "logprobs": null
        }
      ],
      "usage": {
        "prompt_tokens": 11944,
        "completion_tokens": 141,
        "total_tokens": 12085
      }
    }
  ]
}
相关推荐
许泽宇的技术分享2 小时前
解密Anthropic的MCP Inspector:从协议调试到AI应用开发的全栈架构之旅
人工智能·架构·typescript·mcp·ai开发工具
iFlow_AI7 小时前
知识驱动开发:用iFlow工作流构建本地知识库
前端·ai·rag·mcp·iflow·iflow cli·iflowcli
qdprobot8 小时前
齐护机器人AiTallpro小智AI图形化编程Mixly Scratch MQTT MCP远程控制
人工智能·mqtt·机器人·图形化编程·ai对话·mcp·小智ai
早川不爱吃香菜9 小时前
MCP 教程:使用高德地图 MCP Server 规划行程
mcp·trae
TeamDev1 天前
使用 MCP 自动化 JxBrowser
浏览器自动化·jxbrowser·mcp·模型上下文协议·mcp 自动化·jxbrowser 自动化·jxbrowser mcp
ChaITSimpleLove1 天前
使用 .net10 构建 AI 友好的 RSS 订阅机器人
人工智能·.net·mcp·ai bot·rss bot
妮妮分享2 天前
维智 MCP 接口服务技术支持指南
mcp·mcp server·维智 mcp·智能体接口
感谢地心引力2 天前
【AI】免费的代价?Google AI Studio 使用指南与 Cherry Studio + MCP 实战教程
人工智能·ai·google·chatgpt·gemini·mcp·cherry studio
AI架构师易筋2 天前
模型上下文协议(MCP)完全指南:从AI代理痛点到实战开发
人工智能·microsoft·语言模型·llm·mcp
qdprobot2 天前
齐护AiTall pro ESP32S3 小智AI对话 MQTT MCP 开发板Mixly Scratch Steam图形化编程创客教育
人工智能·mqtt·scratch·mixly·mcp·小智ai·齐护机器人aitall pro