Mastra.getVector()
.getVector() 方法用于按名称获取 vector store。此方法接受一个 string 参数,用于指定 vector store 名称。
使用示例使用示例的直接链接
mastra.getVector('testVectorStore')
参数参数的直接链接
name:
TVectorName extends keyof TVectors
要获取的 vector store 名称。必须是 Mastra 配置中存在的有效 vector store 名称。
返回值返回值的直接链接
vector:
TVectors[TVectorName]
具有指定名称的 vector store 实例。如果未找到该 vector store,则抛出错误。