feat: add memory functionality to multi-function agent and update schemas

- Integrated memory capabilities into the multi-function agent using LibSQLStore for persistent storage.
- Updated agent instructions to reflect memory features, allowing the agent to remember previous conversations and user preferences.
- Modified request schemas to include optional memory parameters for better context management in interactions.
This commit is contained in:
dzq 2025-12-16 11:10:08 +08:00
parent 4d1e218437
commit 4a7ddd9e72
6 changed files with 512 additions and 5 deletions

5
.gitignore vendored
View File

@ -63,3 +63,8 @@ temp/
# Mastra specific
.mastra/output/
# Memory database files
memory.db*
memory.db-shm
memory.db-wal

9
.mcp.json Normal file
View File

@ -0,0 +1,9 @@
{
"mcpServers": {
"mastra": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@mastra/mcp-docs-server"]
}
}
}

View File

@ -21,6 +21,8 @@
"@ai-sdk/deepseek": "^1.0.31",
"@ai-sdk/openai": "^2.0.80",
"@mastra/core": "^0.24.8",
"@mastra/libsql": "^0.16.4",
"@mastra/memory": "^0.15.13",
"axios": "^1.13.2",
"cors": "^2.8.5",
"express": "^5.1.0",

View File

@ -17,6 +17,12 @@ importers:
'@mastra/core':
specifier: ^0.24.8
version: 0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)
'@mastra/libsql':
specifier: ^0.16.4
version: 0.16.4(@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13))
'@mastra/memory':
specifier: ^0.15.13
version: 0.15.13(@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13))(react@19.2.1)(zod@4.1.13)
axios:
specifier: ^1.13.2
version: 1.13.2
@ -103,6 +109,12 @@ packages:
peerDependencies:
zod: ^3.25.76 || ^4.1.8
'@ai-sdk/gateway@1.0.33':
resolution: {integrity: sha512-v9i3GPEo4t3fGcSkQkc07xM6KJN75VUv7C1Mqmmsu2xD8lQwnQfsrgAXyNuWe20yGY0eHuheSPDZhiqsGKtH1g==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
'@ai-sdk/gateway@2.0.12':
resolution: {integrity: sha512-W+cB1sOWvPcz9qiIsNtD+HxUrBUva2vWv2K1EFukuImX+HA0uZx3EyyOjhYQ9gtf/teqEG80M6OvJ7xx/VLV2A==}
engines: {node: '>=18'}
@ -145,6 +157,12 @@ packages:
peerDependencies:
zod: ^3.23.8
'@ai-sdk/provider-utils@3.0.10':
resolution: {integrity: sha512-T1gZ76gEIwffep6MWI0QNy9jgoybUHE7TRaHB5k54K8mF91ciGFlbtCGxDYhMH3nCRergKwYFIDeFF0hJSIQHQ==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
'@ai-sdk/provider-utils@3.0.12':
resolution: {integrity: sha512-ZtbdvYxdMoria+2SlNarEk6Hlgyf+zzcznlD55EAl+7VZvJaSg2sqPvwArY7L6TfDEDJsnCq0fdhBSkYo0Xqdg==}
engines: {node: '>=18'}
@ -703,6 +721,67 @@ packages:
'@jsdevtools/ono@7.1.3':
resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==}
'@libsql/client@0.15.15':
resolution: {integrity: sha512-twC0hQxPNHPKfeOv3sNT6u2pturQjLcI+CnpTM0SjRpocEGgfiZ7DWKXLNnsothjyJmDqEsBQJ5ztq9Wlu470w==}
'@libsql/core@0.15.15':
resolution: {integrity: sha512-C88Z6UKl+OyuKKPwz224riz02ih/zHYI3Ho/LAcVOgjsunIRZoBw7fjRfaH9oPMmSNeQfhGklSG2il1URoOIsA==}
'@libsql/darwin-arm64@0.5.22':
resolution: {integrity: sha512-4B8ZlX3nIDPndfct7GNe0nI3Yw6ibocEicWdC4fvQbSs/jdq/RC2oCsoJxJ4NzXkvktX70C1J4FcmmoBy069UA==}
cpu: [arm64]
os: [darwin]
'@libsql/darwin-x64@0.5.22':
resolution: {integrity: sha512-ny2HYWt6lFSIdNFzUFIJ04uiW6finXfMNJ7wypkAD8Pqdm6nAByO+Fdqu8t7sD0sqJGeUCiOg480icjyQ2/8VA==}
cpu: [x64]
os: [darwin]
'@libsql/hrana-client@0.7.0':
resolution: {integrity: sha512-OF8fFQSkbL7vJY9rfuegK1R7sPgQ6kFMkDamiEccNUvieQ+3urzfDFI616oPl8V7T9zRmnTkSjMOImYCAVRVuw==}
'@libsql/isomorphic-fetch@0.3.1':
resolution: {integrity: sha512-6kK3SUK5Uu56zPq/Las620n5aS9xJq+jMBcNSOmjhNf/MUvdyji4vrMTqD7ptY7/4/CAVEAYDeotUz60LNQHtw==}
engines: {node: '>=18.0.0'}
'@libsql/isomorphic-ws@0.1.5':
resolution: {integrity: sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==}
'@libsql/linux-arm-gnueabihf@0.5.22':
resolution: {integrity: sha512-3Uo3SoDPJe/zBnyZKosziRGtszXaEtv57raWrZIahtQDsjxBVjuzYQinCm9LRCJCUT5t2r5Z5nLDPJi2CwZVoA==}
cpu: [arm]
os: [linux]
'@libsql/linux-arm-musleabihf@0.5.22':
resolution: {integrity: sha512-LCsXh07jvSojTNJptT9CowOzwITznD+YFGGW+1XxUr7fS+7/ydUrpDfsMX7UqTqjm7xG17eq86VkWJgHJfvpNg==}
cpu: [arm]
os: [linux]
'@libsql/linux-arm64-gnu@0.5.22':
resolution: {integrity: sha512-KSdnOMy88c9mpOFKUEzPskSaF3VLflfSUCBwas/pn1/sV3pEhtMF6H8VUCd2rsedwoukeeCSEONqX7LLnQwRMA==}
cpu: [arm64]
os: [linux]
'@libsql/linux-arm64-musl@0.5.22':
resolution: {integrity: sha512-mCHSMAsDTLK5YH//lcV3eFEgiR23Ym0U9oEvgZA0667gqRZg/2px+7LshDvErEKv2XZ8ixzw3p1IrBzLQHGSsw==}
cpu: [arm64]
os: [linux]
'@libsql/linux-x64-gnu@0.5.22':
resolution: {integrity: sha512-kNBHaIkSg78Y4BqAdgjcR2mBilZXs4HYkAmi58J+4GRwDQZh5fIUWbnQvB9f95DkWUIGVeenqLRFY2pcTmlsew==}
cpu: [x64]
os: [linux]
'@libsql/linux-x64-musl@0.5.22':
resolution: {integrity: sha512-UZ4Xdxm4pu3pQXjvfJiyCzZop/9j/eA2JjmhMaAhe3EVLH2g11Fy4fwyUp9sT1QJYR1kpc2JLuybPM0kuXv/Tg==}
cpu: [x64]
os: [linux]
'@libsql/win32-x64-msvc@0.5.22':
resolution: {integrity: sha512-Fj0j8RnBpo43tVZUVoNK6BV/9AtDUM5S7DF3LB4qTYg1LMSZqi3yeCneUTLJD6XomQJlZzbI4mst89yspVSAnA==}
cpu: [x64]
os: [win32]
'@mastra/core@0.24.8':
resolution: {integrity: sha512-7NW4duc26RfCXbi4ViT0/deG8kWZX4HAJKC6UNHUS5jSLgIof0iwS1yU5yA8NaPXe14I0WG1pEmnkEVYnXgGLw==}
engines: {node: '>=20'}
@ -715,11 +794,22 @@ packages:
'@mastra/core': '>=0.24.0-0 <0.25.0-0'
zod: ^3.25.0 || ^4.0.0
'@mastra/libsql@0.16.4':
resolution: {integrity: sha512-IwPZipHBlamNAdnQRpwOxw1AeQsY7QaOBpJN+VbHz8tf819zGZkDOLKsh2eWLMmnQdyqc8hucGCA8HTnejtkkA==}
peerDependencies:
'@mastra/core': '>=0.21.2-0 <0.25.0-0'
'@mastra/loggers@0.10.19':
resolution: {integrity: sha512-H4qTgqKt3YJxz6B1I0lOPqRpOpR8gEzYYNZ6iO/TGQ11r+wvug/i80MAKr0B1IBZvr9l18vr7wjYCdTxPqaAGg==}
peerDependencies:
'@mastra/core': '>=0.18.1-0 <0.25.0-0'
'@mastra/memory@0.15.13':
resolution: {integrity: sha512-88RBgT1VIseyvKdkzVJFw88gtFmf/+6vOMwJaeLzSq++oHtoD+A0nkUvCtuX3aYsicpf5IPUBnvEgJ9pH6J/gg==}
peerDependencies:
'@mastra/core': '>=0.20.1-0 <0.25.0-0'
zod: ^3.25.0 || ^4.0.0
'@mastra/schema-compat@0.11.9':
resolution: {integrity: sha512-LXEChx5n3bcuSFWQ5Wn9K2spLEpzHGf+DCnAeryuecpOo8VGLJ2QCK9Ugsnfjuc6hC0Ha73HvL1AD8zDhjmYOg==}
peerDependencies:
@ -732,6 +822,9 @@ packages:
'@mastra/core': '>=0.24.0-0 <0.25.0-0'
zod: ^3.25.0 || ^4.0.0
'@neon-rs/load@0.0.4':
resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==}
'@neon-rs/load@0.1.82':
resolution: {integrity: sha512-H4Gu2o5kPp+JOEhRrOQCnJnf7X6sv9FBLttM/wSbb4efsgFWeHzfU/ItZ01E5qqEk+U6QGdeVO7lxXIAtYHr5A==}
@ -1285,6 +1378,34 @@ packages:
'@protobufjs/utf8@1.1.0':
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
'@redis/bloom@5.10.0':
resolution: {integrity: sha512-doIF37ob+l47n0rkpRNgU8n4iacBlKM9xLiP1LtTZTvz8TloJB8qx/MgvhMhKdYG+CvCY2aPBnN2706izFn/4A==}
engines: {node: '>= 18'}
peerDependencies:
'@redis/client': ^5.10.0
'@redis/client@5.10.0':
resolution: {integrity: sha512-JXmM4XCoso6C75Mr3lhKA3eNxSzkYi3nCzxDIKY+YOszYsJjuKbFgVtguVPbLMOttN4iu2fXoc2BGhdnYhIOxA==}
engines: {node: '>= 18'}
'@redis/json@5.10.0':
resolution: {integrity: sha512-B2G8XlOmTPUuZtD44EMGbtoepQG34RCDXLZbjrtON1Djet0t5Ri7/YPXvL9aomXqP8lLTreaprtyLKF4tmXEEA==}
engines: {node: '>= 18'}
peerDependencies:
'@redis/client': ^5.10.0
'@redis/search@5.10.0':
resolution: {integrity: sha512-3SVcPswoSfp2HnmWbAGUzlbUPn7fOohVu2weUQ0S+EMiQi8jwjL+aN2p6V3TI65eNfVsJ8vyPvqWklm6H6esmg==}
engines: {node: '>= 18'}
peerDependencies:
'@redis/client': ^5.10.0
'@redis/time-series@5.10.0':
resolution: {integrity: sha512-cPkpddXH5kc/SdRhF0YG0qtjL+noqFT0AcHbQ6axhsPsO7iqPi1cjxgdkE9TNeKiBUUdCaU1DbqkR/LzbzPBhg==}
engines: {node: '>= 18'}
peerDependencies:
'@redis/client': ^5.10.0
'@rolldown/pluginutils@1.0.0-beta.50':
resolution: {integrity: sha512-5e76wQiQVeL1ICOZVUg4LSOVYg9jyhGCin+icYozhsUzM+fHE7kddi1bdiE0jwVqTfkjba3jUFbEkoC9WkdvyA==}
@ -1492,6 +1613,9 @@ packages:
'@standard-schema/spec@1.0.0':
resolution: {integrity: sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==}
'@standard-schema/spec@1.1.0':
resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
'@types/aws-lambda@8.10.152':
resolution: {integrity: sha512-soT/c2gYBnT5ygwiHPmd9a1bftj462NWVk2tKCc1PYHSIacB2UwbTS2zYG4jzag1mRDuzg/OjtxQjQ2NKRB6Rw==}
@ -1601,6 +1725,12 @@ packages:
'@types/tedious@4.0.14':
resolution: {integrity: sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==}
'@types/ws@8.18.1':
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
'@upstash/redis@1.35.8':
resolution: {integrity: sha512-QqLpVCD9PCPE6hlRzOkz864nfijSdazxtyJLIy9ZeTh6kU2nBIKKfjT5HMHjIRD4BCm6TK1dbUT9pxhFjcvpng==}
'@vercel/oidc@3.0.5':
resolution: {integrity: sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw==}
engines: {node: '>= 20'}
@ -1682,6 +1812,12 @@ packages:
react:
optional: true
ai@5.0.60:
resolution: {integrity: sha512-80U/3kmdBW6g+JkLXpz/P2EwkyEaWlPlYtuLUpx/JYK9F7WZh9NnkYoh1KvUi1Sbpo0NyurBTvX0a2AG9mmbDA==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
ai@5.0.97:
resolution: {integrity: sha512-8zBx0b/owis4eJI2tAlV8a1Rv0BANmLxontcAelkLNwEHhgfgXeKpDkhNB6OgV+BJSwboIUDkgd9312DdJnCOQ==}
engines: {node: '>=18'}
@ -1702,6 +1838,9 @@ packages:
array-flatten@1.1.1:
resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==}
async-mutex@0.5.0:
resolution: {integrity: sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==}
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
@ -1784,6 +1923,10 @@ packages:
resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==}
engines: {node: '>=0.8'}
cluster-key-slot@1.1.2:
resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==}
engines: {node: '>=0.10.0'}
color-convert@2.0.1:
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
engines: {node: '>=7.0.0'}
@ -1853,6 +1996,10 @@ packages:
csstype@3.2.3:
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
data-uri-to-buffer@4.0.1:
resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}
engines: {node: '>= 12'}
date-fns@3.6.0:
resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==}
@ -1932,6 +2079,10 @@ packages:
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
detect-libc@2.0.2:
resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==}
engines: {node: '>=8'}
detect-libc@2.1.2:
resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}
engines: {node: '>=8'}
@ -2069,6 +2220,10 @@ packages:
picomatch:
optional: true
fetch-blob@3.2.0:
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
engines: {node: ^12.20 || >= 14.13}
figures@6.1.0:
resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==}
engines: {node: '>=18'}
@ -2101,6 +2256,10 @@ packages:
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
engines: {node: '>= 6'}
formdata-polyfill@4.0.10:
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
engines: {node: '>=12.20.0'}
forwarded-parse@2.1.2:
resolution: {integrity: sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==}
@ -2365,6 +2524,9 @@ packages:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
engines: {node: '>=10'}
js-base64@3.7.8:
resolution: {integrity: sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==}
js-tiktoken@1.0.21:
resolution: {integrity: sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g==}
@ -2407,6 +2569,11 @@ packages:
jsonfile@6.2.0:
resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==}
libsql@0.5.22:
resolution: {integrity: sha512-NscWthMQt7fpU8lqd7LXMvT9pi+KhhmTHAJWUB/Lj6MWa0MKFv0F2V4C6WKKpjCVZl0VwcDz4nOI3CyaT1DDiA==}
cpu: [x64, arm64, wasm32, arm]
os: [darwin, linux, win32]
local-pkg@1.1.2:
resolution: {integrity: sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A==}
engines: {node: '>=14'}
@ -2524,6 +2691,11 @@ packages:
resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
engines: {node: '>= 0.6'}
node-domexception@1.0.0:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
deprecated: Use your platform's native DOMException instead
node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
@ -2533,6 +2705,10 @@ packages:
encoding:
optional: true
node-fetch@3.3.2:
resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
node-releases@2.0.27:
resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==}
@ -2610,10 +2786,21 @@ packages:
pathe@2.0.3:
resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}
pg-cloudflare@1.2.7:
resolution: {integrity: sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==}
pg-connection-string@2.9.1:
resolution: {integrity: sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==}
pg-int8@1.0.1:
resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==}
engines: {node: '>=4.0.0'}
pg-pool@3.10.1:
resolution: {integrity: sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==}
peerDependencies:
pg: '>=8.0'
pg-protocol@1.10.3:
resolution: {integrity: sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==}
@ -2621,6 +2808,18 @@ packages:
resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==}
engines: {node: '>=4'}
pg@8.16.3:
resolution: {integrity: sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==}
engines: {node: '>= 16.0.0'}
peerDependencies:
pg-native: '>=3.0.1'
peerDependenciesMeta:
pg-native:
optional: true
pgpass@1.0.5:
resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==}
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
@ -2675,6 +2874,10 @@ packages:
resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}
engines: {node: '>=0.10.0'}
postgres@3.4.7:
resolution: {integrity: sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==}
engines: {node: '>=12'}
posthog-node@4.18.0:
resolution: {integrity: sha512-XROs1h+DNatgKh/AlIlCtDxWzwrKdYDb2mOs58n4yN8BkGN9ewqeQwG5ApS4/IzwCb7HPttUkOVulkYatd2PIw==}
engines: {node: '>=15.0.0'}
@ -2691,6 +2894,9 @@ packages:
process-warning@5.0.0:
resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==}
promise-limit@2.7.0:
resolution: {integrity: sha512-7nJ6v5lnJsXwGprnGXga4wx6d1POjvi5Qmf1ivTRxTjH4Z/9Czja/UCMLVmB9N93GeWOU93XaFaEt6jbuoagNw==}
protobufjs@7.5.4:
resolution: {integrity: sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==}
engines: {node: '>=12.0.0'}
@ -2746,6 +2952,10 @@ packages:
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
engines: {node: '>= 12.13.0'}
redis@5.10.0:
resolution: {integrity: sha512-0/Y+7IEiTgVGPrLFKy8oAEArSyEJkU0zvgV5xyi9NzNQ+SLZmyFbUsWIbgPcd4UdUh00opXGKlXJwMmsis5Byw==}
engines: {node: '>= 18'}
require-directory@2.1.1:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
@ -2990,6 +3200,9 @@ packages:
tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tsx@4.21.0:
resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==}
engines: {node: '>=18.0.0'}
@ -3016,6 +3229,9 @@ packages:
ufo@1.6.1:
resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==}
uncrypto@0.1.3:
resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==}
undici-types@7.16.0:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
@ -3126,6 +3342,10 @@ packages:
typescript:
optional: true
web-streams-polyfill@3.3.3:
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
engines: {node: '>= 8'}
webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
@ -3144,6 +3364,18 @@ packages:
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@8.18.3:
resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: '>=5.0.2'
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
wsl-utils@0.1.0:
resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==}
engines: {node: '>=18'}
@ -3155,6 +3387,9 @@ packages:
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
engines: {node: '>=0.4'}
xxhash-wasm@1.1.0:
resolution: {integrity: sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==}
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
@ -3225,6 +3460,13 @@ snapshots:
'@ai-sdk/provider-utils': 3.0.18(zod@4.1.13)
zod: 4.1.13
'@ai-sdk/gateway@1.0.33(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
'@ai-sdk/provider-utils': 3.0.10(zod@4.1.13)
'@vercel/oidc': 3.0.5
zod: 4.1.13
'@ai-sdk/gateway@2.0.12(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
@ -3269,24 +3511,31 @@ snapshots:
secure-json-parse: 2.7.0
zod: 4.1.13
'@ai-sdk/provider-utils@3.0.10(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.1.13
'@ai-sdk/provider-utils@3.0.12(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.1.13
'@ai-sdk/provider-utils@3.0.16(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.1.13
'@ai-sdk/provider-utils@3.0.17(zod@4.1.13)':
dependencies:
'@ai-sdk/provider': 2.0.0
'@standard-schema/spec': 1.0.0
'@standard-schema/spec': 1.1.0
eventsource-parser: 3.0.6
zod: 4.1.13
@ -3744,6 +3993,68 @@ snapshots:
'@jsdevtools/ono@7.1.3': {}
'@libsql/client@0.15.15':
dependencies:
'@libsql/core': 0.15.15
'@libsql/hrana-client': 0.7.0
js-base64: 3.7.8
libsql: 0.5.22
promise-limit: 2.7.0
transitivePeerDependencies:
- bufferutil
- utf-8-validate
'@libsql/core@0.15.15':
dependencies:
js-base64: 3.7.8
'@libsql/darwin-arm64@0.5.22':
optional: true
'@libsql/darwin-x64@0.5.22':
optional: true
'@libsql/hrana-client@0.7.0':
dependencies:
'@libsql/isomorphic-fetch': 0.3.1
'@libsql/isomorphic-ws': 0.1.5
js-base64: 3.7.8
node-fetch: 3.3.2
transitivePeerDependencies:
- bufferutil
- utf-8-validate
'@libsql/isomorphic-fetch@0.3.1': {}
'@libsql/isomorphic-ws@0.1.5':
dependencies:
'@types/ws': 8.18.1
ws: 8.18.3
transitivePeerDependencies:
- bufferutil
- utf-8-validate
'@libsql/linux-arm-gnueabihf@0.5.22':
optional: true
'@libsql/linux-arm-musleabihf@0.5.22':
optional: true
'@libsql/linux-arm64-gnu@0.5.22':
optional: true
'@libsql/linux-arm64-musl@0.5.22':
optional: true
'@libsql/linux-x64-gnu@0.5.22':
optional: true
'@libsql/linux-x64-musl@0.5.22':
optional: true
'@libsql/win32-x64-msvc@0.5.22':
optional: true
'@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)':
dependencies:
'@a2a-js/sdk': 0.2.5
@ -3848,12 +4159,41 @@ snapshots:
- supports-color
- typescript
'@mastra/libsql@0.16.4(@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13))':
dependencies:
'@libsql/client': 0.15.15
'@mastra/core': 0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)
transitivePeerDependencies:
- bufferutil
- utf-8-validate
'@mastra/loggers@0.10.19(@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13))':
dependencies:
'@mastra/core': 0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)
pino: 9.14.0
pino-pretty: 13.1.3
'@mastra/memory@0.15.13(@mastra/core@0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13))(react@19.2.1)(zod@4.1.13)':
dependencies:
'@mastra/core': 0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)
'@mastra/schema-compat': 0.11.9(ai@4.3.19(react@19.2.1)(zod@4.1.13))(zod@4.1.13)
'@upstash/redis': 1.35.8
ai: 4.3.19(react@19.2.1)(zod@4.1.13)
ai-v5: ai@5.0.60(zod@4.1.13)
async-mutex: 0.5.0
js-tiktoken: 1.0.21
json-schema: 0.4.0
pg: 8.16.3
pg-pool: 3.10.1(pg@8.16.3)
postgres: 3.4.7
redis: 5.10.0
xxhash-wasm: 1.1.0
zod: 4.1.13
zod-to-json-schema: 3.25.0(zod@4.1.13)
transitivePeerDependencies:
- pg-native
- react
'@mastra/schema-compat@0.11.9(ai@4.3.19(react@19.2.1)(zod@4.1.13))(zod@4.1.13)':
dependencies:
ai: 4.3.19(react@19.2.1)(zod@4.1.13)
@ -3869,6 +4209,8 @@ snapshots:
'@mastra/core': 0.24.8(openapi-types@12.1.3)(react@19.2.1)(zod@4.1.13)
zod: 4.1.13
'@neon-rs/load@0.0.4': {}
'@neon-rs/load@0.1.82': {}
'@nodelib/fs.scandir@2.1.5':
@ -4631,6 +4973,26 @@ snapshots:
'@protobufjs/utf8@1.1.0': {}
'@redis/bloom@5.10.0(@redis/client@5.10.0)':
dependencies:
'@redis/client': 5.10.0
'@redis/client@5.10.0':
dependencies:
cluster-key-slot: 1.1.2
'@redis/json@5.10.0(@redis/client@5.10.0)':
dependencies:
'@redis/client': 5.10.0
'@redis/search@5.10.0(@redis/client@5.10.0)':
dependencies:
'@redis/client': 5.10.0
'@redis/time-series@5.10.0(@redis/client@5.10.0)':
dependencies:
'@redis/client': 5.10.0
'@rolldown/pluginutils@1.0.0-beta.50': {}
'@rolldown/pluginutils@1.0.0-beta.53': {}
@ -4769,6 +5131,8 @@ snapshots:
'@standard-schema/spec@1.0.0': {}
'@standard-schema/spec@1.1.0': {}
'@types/aws-lambda@8.10.152': {}
'@types/babel__core@7.20.5':
@ -4916,6 +5280,14 @@ snapshots:
dependencies:
'@types/node': 25.0.0
'@types/ws@8.18.1':
dependencies:
'@types/node': 25.0.0
'@upstash/redis@1.35.8':
dependencies:
uncrypto: 0.1.3
'@vercel/oidc@3.0.5': {}
'@vitejs/plugin-react@5.1.2(vite@7.2.7(@types/node@25.0.0)(tsx@4.21.0)(yaml@2.8.2))':
@ -5022,6 +5394,14 @@ snapshots:
optionalDependencies:
react: 19.2.1
ai@5.0.60(zod@4.1.13):
dependencies:
'@ai-sdk/gateway': 1.0.33(zod@4.1.13)
'@ai-sdk/provider': 2.0.0
'@ai-sdk/provider-utils': 3.0.10(zod@4.1.13)
'@opentelemetry/api': 1.9.0
zod: 4.1.13
ai@5.0.97(zod@4.1.13):
dependencies:
'@ai-sdk/gateway': 2.0.12(zod@4.1.13)
@ -5040,6 +5420,10 @@ snapshots:
array-flatten@1.1.1: {}
async-mutex@0.5.0:
dependencies:
tslib: 2.8.1
asynckit@0.4.0: {}
atomic-sleep@1.0.0: {}
@ -5144,6 +5528,8 @@ snapshots:
clone@2.1.2: {}
cluster-key-slot@1.1.2: {}
color-convert@2.0.1:
dependencies:
color-name: 1.1.4
@ -5197,6 +5583,8 @@ snapshots:
csstype@3.2.3: {}
data-uri-to-buffer@4.0.1: {}
date-fns@3.6.0: {}
dateformat@4.6.3: {}
@ -5240,6 +5628,8 @@ snapshots:
destroy@1.2.0: {}
detect-libc@2.0.2: {}
detect-libc@2.1.2: {}
diff-match-patch@1.0.5: {}
@ -5467,6 +5857,11 @@ snapshots:
optionalDependencies:
picomatch: 4.0.3
fetch-blob@3.2.0:
dependencies:
node-domexception: 1.0.0
web-streams-polyfill: 3.3.3
figures@6.1.0:
dependencies:
is-unicode-supported: 2.1.0
@ -5514,6 +5909,10 @@ snapshots:
hasown: 2.0.2
mime-types: 2.1.35
formdata-polyfill@4.0.10:
dependencies:
fetch-blob: 3.2.0
forwarded-parse@2.1.2: {}
forwarded@0.2.0: {}
@ -5722,6 +6121,8 @@ snapshots:
joycon@3.1.1: {}
js-base64@3.7.8: {}
js-tiktoken@1.0.21:
dependencies:
base64-js: 1.5.1
@ -5761,6 +6162,21 @@ snapshots:
optionalDependencies:
graceful-fs: 4.2.11
libsql@0.5.22:
dependencies:
'@neon-rs/load': 0.0.4
detect-libc: 2.0.2
optionalDependencies:
'@libsql/darwin-arm64': 0.5.22
'@libsql/darwin-x64': 0.5.22
'@libsql/linux-arm-gnueabihf': 0.5.22
'@libsql/linux-arm-musleabihf': 0.5.22
'@libsql/linux-arm64-gnu': 0.5.22
'@libsql/linux-arm64-musl': 0.5.22
'@libsql/linux-x64-gnu': 0.5.22
'@libsql/linux-x64-musl': 0.5.22
'@libsql/win32-x64-msvc': 0.5.22
local-pkg@1.1.2:
dependencies:
mlly: 1.8.0
@ -5887,10 +6303,18 @@ snapshots:
negotiator@1.0.0: {}
node-domexception@1.0.0: {}
node-fetch@2.7.0:
dependencies:
whatwg-url: 5.0.0
node-fetch@3.3.2:
dependencies:
data-uri-to-buffer: 4.0.1
fetch-blob: 3.2.0
formdata-polyfill: 4.0.10
node-releases@2.0.27: {}
npm-run-path@6.0.0:
@ -5949,8 +6373,17 @@ snapshots:
pathe@2.0.3: {}
pg-cloudflare@1.2.7:
optional: true
pg-connection-string@2.9.1: {}
pg-int8@1.0.1: {}
pg-pool@3.10.1(pg@8.16.3):
dependencies:
pg: 8.16.3
pg-protocol@1.10.3: {}
pg-types@2.2.0:
@ -5961,6 +6394,20 @@ snapshots:
postgres-date: 1.0.7
postgres-interval: 1.2.0
pg@8.16.3:
dependencies:
pg-connection-string: 2.9.1
pg-pool: 3.10.1(pg@8.16.3)
pg-protocol: 1.10.3
pg-types: 2.2.0
pgpass: 1.0.5
optionalDependencies:
pg-cloudflare: 1.2.7
pgpass@1.0.5:
dependencies:
split2: 4.2.0
picocolors@1.1.1: {}
picomatch@2.3.1: {}
@ -6035,6 +6482,8 @@ snapshots:
dependencies:
xtend: 4.0.2
postgres@3.4.7: {}
posthog-node@4.18.0:
dependencies:
axios: 1.13.2
@ -6049,6 +6498,8 @@ snapshots:
process-warning@5.0.0: {}
promise-limit@2.7.0: {}
protobufjs@7.5.4:
dependencies:
'@protobufjs/aspromise': 1.1.2
@ -6110,6 +6561,14 @@ snapshots:
real-require@0.2.0: {}
redis@5.10.0:
dependencies:
'@redis/bloom': 5.10.0(@redis/client@5.10.0)
'@redis/client': 5.10.0
'@redis/json': 5.10.0(@redis/client@5.10.0)
'@redis/search': 5.10.0(@redis/client@5.10.0)
'@redis/time-series': 5.10.0(@redis/client@5.10.0)
require-directory@2.1.1: {}
require-in-the-middle@7.5.2:
@ -6408,6 +6867,8 @@ snapshots:
tr46@0.0.3: {}
tslib@2.8.1: {}
tsx@4.21.0:
dependencies:
esbuild: 0.27.1
@ -6434,6 +6895,8 @@ snapshots:
ufo@1.6.1: {}
uncrypto@0.1.3: {}
undici-types@7.16.0: {}
unicorn-magic@0.3.0: {}
@ -6508,6 +6971,8 @@ snapshots:
optionalDependencies:
typescript: 5.9.3
web-streams-polyfill@3.3.3: {}
webidl-conversions@3.0.1: {}
whatwg-url@5.0.0:
@ -6527,6 +6992,8 @@ snapshots:
wrappy@1.0.2: {}
ws@8.18.3: {}
wsl-utils@0.1.0:
dependencies:
is-wsl: 3.1.0
@ -6535,6 +7002,8 @@ snapshots:
xtend@4.0.2: {}
xxhash-wasm@1.1.0: {}
y18n@5.0.8: {}
yallist@3.1.1: {}

View File

@ -8,17 +8,28 @@ import {
goodsTool,
} from "../tools";
import { createDeepSeek } from '@ai-sdk/deepseek';
import { Memory } from "@mastra/memory";
import { LibSQLStore } from "@mastra/libsql";
const deepseek = createDeepSeek({
apiKey: 'sk-8603b08e1125422ca6238c8b4a1a40d8',
});
// 创建一个基本内存实例
const memory = new Memory({
storage: new LibSQLStore({
url: "file:./memory.db", // 相对于 `.mastra/output` 目录的相对路径
}),
options: {
lastMessages: 20,
},
});
export const multiFunctionAgent = new Agent({
name: "Multi-Function Agent",
instructions: `
1. ****使
2. ****
@ -28,12 +39,15 @@ export const multiFunctionAgent = new Agent({
6. ****使ID获取单个商品详情
earlier
使
使
`,
model: deepseek('deepseek-chat'),
memory: memory,
tools: {
weatherTool,
timeTool,

View File

@ -3,6 +3,10 @@ import { z } from 'zod';
export const generateRequestSchema = z.object({
message: z.string().min(1, 'Message cannot be empty').max(1000, 'Message too long'),
options: z.object({
memory: z.object({
thread: z.string().optional(),
resource: z.string().optional(),
}).optional(),
temperature: z.number().min(0).max(2).optional(),
maxTokens: z.number().min(1).max(4096).optional(),
}).optional(),
@ -11,6 +15,10 @@ export const generateRequestSchema = z.object({
export const streamRequestSchema = z.object({
message: z.string().min(1, 'Message cannot be empty').max(1000, 'Message too long'),
options: z.object({
memory: z.object({
thread: z.string().optional(),
resource: z.string().optional(),
}).optional(),
temperature: z.number().min(0).max(2).optional(),
maxTokens: z.number().min(1).max(4096).optional(),
}).optional(),