-
Notifications
You must be signed in to change notification settings - Fork 60.6k
Feature plugin (GPTs like action based on function call) #5331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 39 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
c99cd31
add openapi-client-axios
lloydzhou f5209fc
stash code
lloydzhou 29b5cd9
ts error
lloydzhou f3f6dc5
stash code
lloydzhou d212df8
stash code
lloydzhou f7a5f83
stash code
lloydzhou d58b99d
stash code
lloydzhou 341a52a
stash code
lloydzhou 7fc0d11
create common function stream for fetchEventSource
lloydzhou d2cb984
add processToolMessage callback
lloydzhou 571ce11
stash code
lloydzhou cac99e3
add Plugin page
lloydzhou 271f58d
stash code
lloydzhou 9326ff9
ts error
lloydzhou 2214689
add gapier proxy
lloydzhou b2965e1
update
lloydzhou f652f73
plugin add auth config
lloydzhou 877668b
hotfix
lloydzhou 801b625
claude support function call
lloydzhou 078305f
kimi support function call
lloydzhou 6435e7a
update readme
lloydzhou 3ec67f9
add load from url
lloydzhou 2b317f6
add config auth location
lloydzhou 236736d
remove no need code
lloydzhou 4fdd997
hotfix
lloydzhou d30351e
update readme
lloydzhou c7bc93b
Merge remote-tracking branch 'connectai/main' into feature/plugin
lloydzhou 0a5522d
update
lloydzhou 7180ed9
hotfix
lloydzhou 6ab6b3d
remove no need code
lloydzhou 04e1ab6
update readme
lloydzhou f9a047a
using tauri http api run plugin to fixed cors in App
lloydzhou 09aec7b
using tauri http api run plugin to fixed cors in App
lloydzhou 9820193
Merge pull request #6 from ConnectAI-E/feature/plugin-app-cors
lloydzhou b590d08
disable nextjs proxy, then can using dalle as plugin
lloydzhou caf50b6
move artifacts into mask settings
lloydzhou 80b8f95
move artifacts into mask settings
lloydzhou f32dd69
Merge pull request #7 from ConnectAI-E/feature/plugin-artifact
lloydzhou 7c0acc7
hotfix tools empty array
lloydzhou 7455978
default enable artifact
lloydzhou 9275f2d
add awesome plugin repo url
lloydzhou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,13 +91,13 @@ For enterprise inquiries, please contact: **[email protected]** | |
| - [x] Desktop App with tauri | ||
| - [x] Self-host Model: Fully compatible with [RWKV-Runner](https://github.com/josStorer/RWKV-Runner), as well as server deployment of [LocalAI](https://github.com/go-skynet/LocalAI): llama/gpt4all/rwkv/vicuna/koala/gpt4all-j/cerebras/falcon/dolly etc. | ||
| - [x] Artifacts: Easily preview, copy and share generated content/webpages through a separate window [#5092](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/pull/5092) | ||
| - [x] Plugins: support artifacts, network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) | ||
| - [x] artifacts | ||
| - [ ] network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) | ||
| - [x] Plugins: support network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) [#5353](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5353) | ||
| - [x] network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) [#5353](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5353) | ||
| - [ ] local knowledge base | ||
|
|
||
| ## What's New | ||
|
|
||
| - 🚀 v2.15.0 Now supports Plugins! Read this: [NextChat-Awesome-Plugins](https://github.com/ChatGPTNextWeb/NextChat-Awesome-Plugins) | ||
| - 🚀 v2.14.0 Now supports Artifacts & SD | ||
| - 🚀 v2.10.1 support Google Gemini Pro model. | ||
| - 🚀 v2.9.11 you can use azure endpoint now. | ||
|
|
@@ -128,13 +128,13 @@ For enterprise inquiries, please contact: **[email protected]** | |
| - [x] 使用 tauri 打包桌面应用 | ||
| - [x] 支持自部署的大语言模型:开箱即用 [RWKV-Runner](https://github.com/josStorer/RWKV-Runner) ,服务端部署 [LocalAI 项目](https://github.com/go-skynet/LocalAI) llama / gpt4all / rwkv / vicuna / koala / gpt4all-j / cerebras / falcon / dolly 等等,或者使用 [api-for-open-llm](https://github.com/xusenlinzy/api-for-open-llm) | ||
| - [x] Artifacts: 通过独立窗口,轻松预览、复制和分享生成的内容/可交互网页 [#5092](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/pull/5092) | ||
| - [x] 插件机制,支持 artifacts,联网搜索、计算器、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) | ||
| - [x] artifacts | ||
| - [ ] 支持联网搜索、计算器、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) | ||
| - [x] 插件机制,支持`联网搜索`、`计算器`、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) [#5353](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5353) | ||
| - [x] 支持联网搜索、计算器、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) [#5353](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/issues/5353) | ||
| - [ ] 本地知识库 | ||
lloydzhou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 最新动态 | ||
|
|
||
| - 🚀 v2.15.0 现在支持插件功能了!了解更多:[NextChat-Awesome-Plugins](https://github.com/ChatGPTNextWeb/NextChat-Awesome-Plugins) | ||
| - 🚀 v2.14.0 现在支持 Artifacts & SD 了。 | ||
| - 🚀 v2.10.1 现在支持 Gemini Pro 模型。 | ||
| - 🚀 v2.9.11 现在可以使用自定义 Azure 服务了。 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| import { NextRequest, NextResponse } from "next/server"; | ||
|
|
||
| export async function handle( | ||
| req: NextRequest, | ||
| { params }: { params: { path: string[] } }, | ||
| ) { | ||
| console.log("[Proxy Route] params ", params); | ||
|
|
||
| if (req.method === "OPTIONS") { | ||
| return NextResponse.json({ body: "OK" }, { status: 200 }); | ||
| } | ||
|
|
||
| // remove path params from searchParams | ||
| req.nextUrl.searchParams.delete("path"); | ||
| req.nextUrl.searchParams.delete("provider"); | ||
|
|
||
| const subpath = params.path.join("/"); | ||
| const fetchUrl = `${req.headers.get( | ||
| "x-base-url", | ||
| )}/${subpath}?${req.nextUrl.searchParams.toString()}`; | ||
| const skipHeaders = ["connection", "host", "origin", "referer", "cookie"]; | ||
| const headers = new Headers( | ||
| Array.from(req.headers.entries()).filter((item) => { | ||
| if ( | ||
| item[0].indexOf("x-") > -1 || | ||
| item[0].indexOf("sec-") > -1 || | ||
| skipHeaders.includes(item[0]) | ||
| ) { | ||
| return false; | ||
| } | ||
| return true; | ||
| }), | ||
| ); | ||
| const controller = new AbortController(); | ||
| const fetchOptions: RequestInit = { | ||
| headers, | ||
| method: req.method, | ||
| body: req.body, | ||
| // to fix #2485: https://stackoverflow.com/questions/55920957/cloudflare-worker-typeerror-one-time-use-body | ||
| redirect: "manual", | ||
| // @ts-ignore | ||
| duplex: "half", | ||
| signal: controller.signal, | ||
| }; | ||
|
|
||
| const timeoutId = setTimeout( | ||
| () => { | ||
| controller.abort(); | ||
| }, | ||
| 10 * 60 * 1000, | ||
| ); | ||
|
|
||
| try { | ||
| const res = await fetch(fetchUrl, fetchOptions); | ||
| // to prevent browser prompt for credentials | ||
| const newHeaders = new Headers(res.headers); | ||
| newHeaders.delete("www-authenticate"); | ||
| // to disable nginx buffering | ||
| newHeaders.set("X-Accel-Buffering", "no"); | ||
|
|
||
| // The latest version of the OpenAI API forced the content-encoding to be "br" in json response | ||
| // So if the streaming is disabled, we need to remove the content-encoding header | ||
| // Because Vercel uses gzip to compress the response, if we don't remove the content-encoding header | ||
| // The browser will try to decode the response with brotli and fail | ||
| newHeaders.delete("content-encoding"); | ||
|
|
||
| return new Response(res.body, { | ||
| status: res.status, | ||
| statusText: res.statusText, | ||
| headers: newHeaders, | ||
| }); | ||
| } finally { | ||
| clearTimeout(timeoutId); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.