QVeris 文档
什么是 QVeris
QVeris 是一个为 LLM Agent 设计的工具搜索 + 工具执行层。它让你的 Agent 能够:
- 使用自然语言搜索实时工具(API、数据源、自动化)。
- 通过传递所需参数执行任何发现的工具。
QVeris 在 Agent 循环(工具发现 → 工具执行 → 将结果反馈给模型)中运行良好,并支持多种集成方式。
快速开始
有三种方式使用 QVeris。
在支持 MCP 的任何地方使用 QVeris MCP
如果您的客户端支持模型上下文协议 (MCP),您可以添加官方 QVeris MCP 服务器并立即获得:
search_toolsexecute_tool
配置(Cursor / 任意 MCP 客户端)
JSON
Line Numbers
1{
2 "mcpServers": {
3 "qveris": {
4 "command": "npx",
5 "args": ["@qverisai/mcp"],
6 "env": {
7 "QVERIS_API_KEY": "your-api-key-here"
8 }
9 }
10 }
11}试试看
"帮我找一个天气工具并查询东京当前的天气"
助手将会:
- 调用 search_tools 并传入功能描述查询(例如 "weather")
- 从结果中选择一个工具
- 调用 execute_tool 并传入工具 ID 和参数
使用 QVeris Python SDK
从 GitHub 获取并安装:
bash
Line Numbers
pip install qveris设置环境变量:
QVERIS_API_KEY(from QVeris)OPENAI_API_KEY(or your OpenAI-compatible provider key)OPENAI_BASE_URL(optional; for OpenAI-compatible providers)
最简流式示例:
Python
Line Numbers
1import asyncio
2from qveris import Agent, Message
3
4async def main():
5 agent = Agent()
6 messages = [Message(role="user", content="Find a weather tool and check New York weather.")]
7 async for event in agent.run(messages):
8 if event.type == "content" and event.content:
9 print(event.content, end="", flush=True)
10
11if __name__ == "__main__":
12 asyncio.run(main())直接调用 QVeris REST API
基础 URL
bash
Line Numbers
https://qveris.ai/api/v1认证
在 Authorization 请求头中发送您的 API 密钥:
JSON
Line Numbers
Authorization: Bearer YOUR_API_KEY1) 搜索工具
POST /search
您将获得一个 search_id 和工具列表(每个工具包含 tool_id、参数模式、示例等)。
Line Numbers
1curl -sS -X POST "https://qveris.ai/api/v1/search" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d "{\"query\":\"weather forecast API\",\"limit\":10}"2) 执行工具
POST /tools/execute?tool_id={tool_id}
如果工具输出超过 max_response_size,响应将包含 truncated_content 以及临时的 full_content_file_url。
Line Numbers
1curl -sS -X POST "https://qveris.ai/api/v1/tools/execute?tool_id=openweathermap_current_weather" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d "{\"search_id\":\"YOUR_SEARCH_ID\",\"parameters\":{\"city\":\"London\",\"units\":\"metric\"},\"max_response_size\":20480}"如何获取 API 密钥
- 前往 QVeris (qveris.ai)
- 登录 / 创建账户
- 创建 API 密钥
- 使用方式:
QVERIS_API_KEY环境变量(MCP / Python SDK),或Authorization: Bearer ...请求头(REST API)
推荐的系统提示词
启用 QVeris 工具时,在您的助手系统提示词中使用以下内容(复制/粘贴):
You are a helpful assistant that can dynamically search and execute tools to help the user. First think about what kind of tools might be useful to accomplish the user's task. Then use the search_tools tool with query describing the capability of the tool, not what params you want to pass to the tool later. Then call suitable searched tool(s) using the execute_tool tool, passing parameters to the searched tool through params_to_tool. If tool has weighted_success_rate and avg_execution_time (in seconds), consider them when selecting which tool to call. You could reference the examples given if any for each tool. You could call make multiple tool calls in a single response.