diff --git a/README.md b/README.md index 7e82c2404..a1871a2eb 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ - 环境变量:`BING_SEARCH_API_KEY` - 申请地址:[Web Search API | Microsoft Bing](https://www.microsoft.com/en-us/bing/apis/bing-web-search-api) - - ChooseSearchEngine + - ChooseSearchEngine(作者:[hang666](https://github.com/hang666)) - 环境变量:`CHOOSE_SEARCH_ENGINE` @@ -107,6 +107,14 @@ - 使用本插件需要一定的专业知识,Stable Diffusion 本身的相关问题不在本项目的解答范围内,如果您确定要使用本插件请参考 [Stable Diffusion 插件配置指南](./docs/stable-diffusion-plugin-cn.md) 文档进行配置 - StableDiffusion 插件需要配置对象存储服务,请参考 [对象存储服务配置指南](./docs/s3-oss.md) 配置 - Arxiv + - B站相关插件(作者:[fred913](https://github.com/fred913)) + - bilibili 视频信息获取(建议使用以下插件时同时启用本插件) + - bilibili 视频搜索 + - 需配置环境变量 `BILIBILI_COOKIES` + - bilibili 听歌识曲 + - 需提前部署 [bilivid-metaprocess-server](https://github.com/fred913/bilivid-metaprocess-server) 并配置环境变量 `BILIVID_METAPROCESS_SERVER_ADDRESS` + - bilibili视频总结 + - 需配置环境变量 `BILIBILI_COOKIES` - 支持 gemini-pro, gemini-pro-vision 模型 - 以下功能目前还不支持 diff --git a/app/api/langchain-tools/bili_wbi_tools.ts b/app/api/langchain-tools/bili_wbi_tools.ts index 6f763e574..421480559 100644 --- a/app/api/langchain-tools/bili_wbi_tools.ts +++ b/app/api/langchain-tools/bili_wbi_tools.ts @@ -79,12 +79,3 @@ export async function getWbiKeys(): Promise<{ ), }; } - -// async function main(): Promise { -// const web_keys: { img_key: string, sub_key: string } = await getWbiKeys() -// const params: Record = { foo: '114', bar: '514', baz: 1919810 } -// const img_key: string = web_keys.img_key -// const sub_key: string = web_keys.sub_key -// const query: string = encWbi(params, img_key, sub_key) -// console.log(query) -// } diff --git a/app/api/langchain-tools/bilibili_vid_conclusion.ts b/app/api/langchain-tools/bilibili_vid_conclusion.ts index 99f70f512..31a123c89 100644 --- a/app/api/langchain-tools/bilibili_vid_conclusion.ts +++ b/app/api/langchain-tools/bilibili_vid_conclusion.ts @@ -76,6 +76,7 @@ export class BilibiliVideoConclusionTool ); const vidinfo = await vidinfo_resp.json(); + console.log("[BilibiliVideoConclusionTool]", vidinfo); const mid = vidinfo.data.owner.mid; const cid = vidinfo.data.pages[pid - 1].cid; @@ -99,6 +100,7 @@ export class BilibiliVideoConclusionTool ); const data = await resp.json(); + console.log("[BilibiliVideoConclusionTool]", data); const model_result = data.data.model_result; switch (model_result.result_type) { case 0: diff --git a/app/api/langchain-tools/bilibili_vid_search.ts b/app/api/langchain-tools/bilibili_vid_search.ts index fe44e2d22..2b94b1faa 100644 --- a/app/api/langchain-tools/bilibili_vid_search.ts +++ b/app/api/langchain-tools/bilibili_vid_search.ts @@ -68,7 +68,7 @@ export class BilibiliVideoSearchTool extends Tool implements RequestTool { }); let rawData: { [key: string]: any } = await resp.json(); - // console.log(rawData); + console.log("[BilibiliVideoSearchTool]", rawData); let data: Array<{ title: string; url: string; @@ -99,7 +99,7 @@ export class BilibiliVideoSearchTool extends Tool implements RequestTool { durationSeconds, }); }); - + console.log("[BilibiliVideoSearchTool]", data); return data; } diff --git a/app/plugins/cn.ts b/app/plugins/cn.ts index 1758f5f4d..64fda79d2 100644 --- a/app/plugins/cn.ts +++ b/app/plugins/cn.ts @@ -32,46 +32,6 @@ export const CN_PLUGINS: BuiltinPlugin[] = [ enable: true, onlyNodeRuntime: false, }, - { - name: "Bilibili视频信息获取", - toolName: "bilibili_video_info", - lang: "cn", - description: "通过Bilibili视频ID获取视频信息,如标题、简介等。", - builtin: true, - createdAt: 1712394126000, - enable: true, - onlyNodeRuntime: false, - }, - { - name: "Bilibili视频搜索", - toolName: "bilibili_video_search", - lang: "cn", - description: "通过关键词搜索Bilibili视频,并获取视频信息。", - builtin: true, - createdAt: 1712394126000, - enable: true, - onlyNodeRuntime: false, - }, - { - name: "Bilibili听歌识曲", - toolName: "bilibili_music_recognition", - lang: "cn", - description: "通过Bilibili视频ID进行听歌识曲识别。", - builtin: true, - createdAt: 1712394126000, - enable: true, - onlyNodeRuntime: false, - }, - { - name: "Bilibili视频总结", - toolName: "bilibili_video_conclusion", - lang: "cn", - description: "通过Bilibili视频ID进行视频总结。", - builtin: true, - createdAt: 1712394126000, - enable: true, - onlyNodeRuntime: false, - }, { name: "维基百科", toolName: "WikipediaQueryRun", @@ -135,4 +95,46 @@ export const CN_PLUGINS: BuiltinPlugin[] = [ enable: false, onlyNodeRuntime: false, }, + { + name: "bilibili视频信息获取", + toolName: "bilibili_video_info", + lang: "cn", + description: "通过bilibili视频ID获取视频信息,如标题、简介等。", + builtin: true, + createdAt: 1712394126000, + enable: false, + onlyNodeRuntime: false, + }, + { + name: "bilibili视频搜索", + toolName: "bilibili_video_search", + lang: "cn", + description: "通过关键词搜索bilibili视频,并获取视频信息。", + builtin: true, + createdAt: 1712394126000, + enable: false, + onlyNodeRuntime: false, + }, + { + name: "bilibili听歌识曲", + toolName: "bilibili_music_recognition", + lang: "cn", + description: + "通过bilibili视频ID进行听歌识曲识别。(建议同时启用`bilibili视频信息获取`插件保证功能完整)", + builtin: true, + createdAt: 1712394126000, + enable: false, + onlyNodeRuntime: false, + }, + { + name: "bilibili视频总结", + toolName: "bilibili_video_conclusion", + lang: "cn", + description: + "通过bilibili视频ID进行视频总结。(建议同时启用`bilibili视频信息获取`插件保证功能完整)", + builtin: true, + createdAt: 1712394126000, + enable: false, + onlyNodeRuntime: false, + }, ];