向量数据库VikingDB
本地文件支持控制台上传,CLI上传,API上传三种方式。
目前本地上传仅支持<5MB文件上传
打开OpenViking首页,点击输入栏右侧“+”,选择“本地上传” 。
添加文件或文件夹,选择目标目录,点击“导入”,即可上传。
示例如下,具体命令与参数详见 add-resource-添加资源。
ov add-resource ./documents/guide.md
首先,使用Temp_upload命令将本地文件上传到OpenVIking Context的临时存储区,获取临时文件ID。示例如下,具体命令与参数详见 Temp_upload- 上传本地文件。
curl -X POST https://xxx/api/v1/resources/temp_upload \ -H "Authorization: Bearer {api_key}" \ -H "X-OpenViking-Agent: {agent_id}" \ -F "file=@my_document.md"
然后,使用Add_resoure命令将临时文件上传到数据库。示例如下,具体命令与参数详见add_resource-导入资源
curl -X POST https://xxx/api/v1/resources \ -H "Authorization: Bearer {api_key}" \ -H "X-OpenViking-Agent: {agent_id}" \ -H "Content-Type: application/json" \ -d '{ "temp_file_id": "upload_abc123def456.md", "reason": "导入外部文档" }'