72 lines
2.0 KiB
JavaScript
72 lines
2.0 KiB
JavaScript
const DEFAULT_TOOLS = [
|
|
{
|
|
type: 'function',
|
|
function: {
|
|
name: 'search_knowledge',
|
|
description: '【强制调用】这是最重要的工具,必须在回答任何用户问题之前调用。知识库包含企业的所有官方信息:产品介绍、退货退款政策、配送物流、保修售后、会员权益、常见问题等。无论用户问什么问题,你都必须先调用此工具查询知识库,基于知识库内容回答。如果知识库没有相关信息,再用自己的知识回答。',
|
|
parameters: {
|
|
type: 'object',
|
|
properties: {
|
|
query: { type: 'string', description: '用户问题的核心关键词或完整问题,如"退货政策"、"产品功能介绍"、"配送时间"' },
|
|
},
|
|
required: ['query'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: 'function',
|
|
function: {
|
|
name: 'query_weather',
|
|
description: '查询指定城市的天气信息',
|
|
parameters: {
|
|
type: 'object',
|
|
properties: {
|
|
city: { type: 'string', description: '城市名称,如北京、上海' },
|
|
},
|
|
required: ['city'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: 'function',
|
|
function: {
|
|
name: 'query_order',
|
|
description: '根据订单号查询订单状态',
|
|
parameters: {
|
|
type: 'object',
|
|
properties: {
|
|
order_id: { type: 'string', description: '订单编号' },
|
|
},
|
|
required: ['order_id'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: 'function',
|
|
function: {
|
|
name: 'get_current_time',
|
|
description: '获取当前日期和时间',
|
|
parameters: {
|
|
type: 'object',
|
|
properties: {},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
type: 'function',
|
|
function: {
|
|
name: 'calculate',
|
|
description: '计算数学表达式,支持加减乘除',
|
|
parameters: {
|
|
type: 'object',
|
|
properties: {
|
|
expression: { type: 'string', description: '数学表达式,如 (100+200)*0.8' },
|
|
},
|
|
required: ['expression'],
|
|
},
|
|
},
|
|
},
|
|
];
|
|
|
|
module.exports = DEFAULT_TOOLS;
|