3
3 个在这里执行
工具托管
grav 能提供给模型的工具。一个工具就是一行数据 —— 由一个
kind 负责执行,所以新增工具不用改代码。
3 个工具
3 个已发布
这个页面只做展示。
下面的卡片就是模型看到的工具定义 ——
kind、端点、鉴权、参数、JSON schema、调用计数。
编辑、启停、删除和试跑在
管理端 · + 新建 和
/api/tools/<name> 里。
一个在这里从没跑过的
manual
工具是正常的:grav 发布它的 schema,由客户端去执行。
3
全部发布给模型
0
0 次错误
2
每种一个文件 + 一行注册
模型怎么用上这些工具
在任意一次 chat completion 里点名托管的工具,然后执行它引导的那次调用。
1 · 声明
curl https://ai.grav.cn/proxy/ai/v1/chat/completions \
-H "Authorization: Bearer $PROXY_AUTH_KEY" \
-d '{"model":"<your-model>",
"messages":[{"role":"user","content":"scrape example.com"}],
"grav_tools":["firecrawl-scrape"]}'
grav_tools 决定要向模型声明哪些托管工具
(不写就是全部已启用的)。客户端自己带了
tools 时,一律以客户端的为准。
2 · 执行
curl https://ai.grav.cn/proxy/ai/v1/tools/call \
-H "Authorization: Bearer $PROXY_AUTH_KEY" \
-d '{"name":"firecrawl-scrape",
"arguments":{"url":"https://example.com"}}'
模型回答里的 tool_calls 条目可以原样丢进来 ——
grav 也认 function.name /
function.arguments。
firecrawl-scrape
HTTP 请求
已发布
无密钥
0 次调用
闲置
Scrape a single URL and return its content as markdown. A key is optional (keyless tier).
| 类型 | http 每次调用发一个请求;url、请求头、查询参数或请求体里可以用 {{param}}。 |
|---|---|
| 端点 |
POST
https://api.firecrawl.dev/v2/scrape
|
| 鉴权 | bearer |
| 参数 | url:string * formats:array = ['markdown'] onlyMainContent:boolean = True |
| JSON schema |
展开{
"additionalProperties": false,
"properties": {
"formats": {
"default": [
"markdown"
],
"description": "Output formats, e.g. [\u0027markdown\u0027].",
"type": "array"
},
"onlyMainContent": {
"default": true,
"description": "Drop navigation / footer noise.",
"type": "boolean"
},
"url": {
"description": "The absolute URL to scrape.",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
|
firecrawl-search
HTTP 请求
已发布
无密钥
0 次调用
闲置
Search the web and return the top results with their content.
| 类型 | http 每次调用发一个请求;url、请求头、查询参数或请求体里可以用 {{param}}。 |
|---|---|
| 端点 |
POST
https://api.firecrawl.dev/v2/search
|
| 鉴权 | bearer |
| 参数 | query:string * limit:integer = 5 |
| JSON schema |
展开{
"additionalProperties": false,
"properties": {
"limit": {
"default": 5,
"description": "How many results to return.",
"type": "integer"
},
"query": {
"description": "The search query.",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}
|
http-get
HTTP 请求
已发布
无密钥
0 次调用
闲置
Fetch any URL over GET and return the raw body as text.
| 类型 | http 每次调用发一个请求;url、请求头、查询参数或请求体里可以用 {{param}}。 |
|---|---|
| 端点 |
GET
{{url}}
|
| 鉴权 | none |
| 参数 | url:string * |
| JSON schema |
展开{
"additionalProperties": false,
"properties": {
"url": {
"description": "Absolute http(s) URL to fetch.",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
}
|