Skip to content

Commit

Permalink
merge develop/CchatGSE-Next to main (#10)
Browse files Browse the repository at this point in the history
* introduce biomedical mask

* generate globally unique id as session id

* To communicate with biochatter, disable stream mode and add param session_id

* communicate with biochatter server (#2)

Co-authored-by: fengsh <[email protected]>

* merge main to develop (#3)

* Update chat.tsx

* Update chat.tsx

* [ADDED] MacOS detect

* [FIXED] now the default key should be CMD on MacOS

* [FIXED] now it should detects all macintosh

* UI Page [Auth Page]

[+] feat(auth.tsx): add support for resetting access token in resetAccessCode function
[+] fix(auth.tsx): fix formatting issue in resetAccessCode function
[+] feat(locales): add support for sub tips in Auth component for multiple languages :
  - Add sub tips in Arabic locale (ar.ts)
  - Add sub tips in Bengali locale (bn.ts)
  - Add sub tips in Chinese locale (cn.ts)
  - Add sub tips in English locale (en.ts)
  - Add sub tips in Indonesian locale (id.ts)

* Feat & Fix UI Page [Auth Page]

[+] feat(auth.tsx): add goChat function to navigate to chat page
[+] fix(auth.tsx): change onClick event from goHome to goChat

* Refactor Locale Indonesia

[+] refactor(id.ts): remove unused import and isApp variable
[+] fix(id.ts): update Unauthorized error message

* Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field

* Client App [Notification]

[+] feat(global.d.ts): add support for window.__TAURI__.notification methods
[+] feat(update.ts): add notification for new version availability
[+] fix(Cargo.toml): add tauri feature "notification-all" to enable notifications
[+] fix(tauri.conf.json): enable all notification features in tauri configuration

* Client App Fix Issue [Bug] 'export' button does not work ChatGPTNextWeb#2884

[+] fix(exporter.tsx): add async keyword to download function
[+] feat(exporter.tsx): add support for saving image file using window.__TAURI__ API
[+] feat(global.d.ts): add types for window.__TAURI__ API methods
[+] feat(locales): add translations for download success and failure messages
[+] feat(sync.ts): add support for generating backup file name with date and time
[+] fix(utils.ts): add async keyword to downloadAs function and add support for saving file using window.__TAURI__ API

* Fix & Feat Client App [Notification]

[+] fix(update.ts): remove unnecessary notification sending when permission is not granted
[+] feat(update.ts): add notification for already up to date version

* Feat & Fix "Client App [Notification]"

[+] feat(update.ts): add support for localization in update notifications
[+] fix(update.ts): add missing semicolon in useUpdateStore function

* Change log

-   config.ts
    -   line 72 remove type confirmation of x as x always has type 'number'
    -   line 135 remove redundant local variable
-   chat.ts
    -   delete unused import

* Change log

-   config.ts
    -   line 72: remove type confirmation of x as x always has type 'number'
    -   line 135: remove the redundant local variable
-   chat.ts
    -   delete the unused import

* Improve tw locale

* Update tauri.conf.json

* 修改界面

似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。

* Update tauri.conf.json

* fix: ChatGPTNextWeb#2981 full screen button not works

* Fix type in sync.ts

Simple typo fix.

* Refactor Mask UI Page [Masks]

[+] refactor(mask.tsx): refactor simple search to be case-insensitive

* 提供同步聊天记录教程,同时翻译多国语言

* Update constant.ts

* 已拆分单个文件、翻译多国语言版本

* docs: fix typo in app/masks/en.ts

* fix serviceWorker cache

* Fix typo in README.md

passsword -> password

* Update README.md

* feat: close ChatGPTNextWeb#3031 user can set larger font size

---------

Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: fengsh <[email protected]>

* make docker-compose.yml work (#4)

* make docker-compose.yml work

* remove useless file

* update .gitignore

---------

Co-authored-by: fengsh <[email protected]>

* upgrade bioserver version (#5)

* upgrade bioserver

* add .bioserver.env.template

* modify comments

---------

Co-authored-by: fengsh <[email protected]>

* Wip/fengsh/develop/chat gse next/merge main to develop (#7)

* Update chat.tsx

* Update chat.tsx

* [ADDED] MacOS detect

* [FIXED] now the default key should be CMD on MacOS

* [FIXED] now it should detects all macintosh

* UI Page [Auth Page]

[+] feat(auth.tsx): add support for resetting access token in resetAccessCode function
[+] fix(auth.tsx): fix formatting issue in resetAccessCode function
[+] feat(locales): add support for sub tips in Auth component for multiple languages :
  - Add sub tips in Arabic locale (ar.ts)
  - Add sub tips in Bengali locale (bn.ts)
  - Add sub tips in Chinese locale (cn.ts)
  - Add sub tips in English locale (en.ts)
  - Add sub tips in Indonesian locale (id.ts)

* Feat & Fix UI Page [Auth Page]

[+] feat(auth.tsx): add goChat function to navigate to chat page
[+] fix(auth.tsx): change onClick event from goHome to goChat

* Refactor Locale Indonesia

[+] refactor(id.ts): remove unused import and isApp variable
[+] fix(id.ts): update Unauthorized error message

* Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field

* Client App [Notification]

[+] feat(global.d.ts): add support for window.__TAURI__.notification methods
[+] feat(update.ts): add notification for new version availability
[+] fix(Cargo.toml): add tauri feature "notification-all" to enable notifications
[+] fix(tauri.conf.json): enable all notification features in tauri configuration

* Client App Fix Issue [Bug] 'export' button does not work ChatGPTNextWeb#2884

[+] fix(exporter.tsx): add async keyword to download function
[+] feat(exporter.tsx): add support for saving image file using window.__TAURI__ API
[+] feat(global.d.ts): add types for window.__TAURI__ API methods
[+] feat(locales): add translations for download success and failure messages
[+] feat(sync.ts): add support for generating backup file name with date and time
[+] fix(utils.ts): add async keyword to downloadAs function and add support for saving file using window.__TAURI__ API

* Fix & Feat Client App [Notification]

[+] fix(update.ts): remove unnecessary notification sending when permission is not granted
[+] feat(update.ts): add notification for already up to date version

* Feat & Fix "Client App [Notification]"

[+] feat(update.ts): add support for localization in update notifications
[+] fix(update.ts): add missing semicolon in useUpdateStore function

* Change log

-   config.ts
    -   line 72 remove type confirmation of x as x always has type 'number'
    -   line 135 remove redundant local variable
-   chat.ts
    -   delete unused import

* Change log

-   config.ts
    -   line 72: remove type confirmation of x as x always has type 'number'
    -   line 135: remove the redundant local variable
-   chat.ts
    -   delete the unused import

* Improve tw locale

* Update tauri.conf.json

* 修改界面

似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。

* Update tauri.conf.json

* fix: ChatGPTNextWeb#2981 full screen button not works

* Fix type in sync.ts

Simple typo fix.

* Refactor Mask UI Page [Masks]

[+] refactor(mask.tsx): refactor simple search to be case-insensitive

* 提供同步聊天记录教程,同时翻译多国语言

* Update constant.ts

* 已拆分单个文件、翻译多国语言版本

* docs: fix typo in app/masks/en.ts

* fix serviceWorker cache

* Fix typo in README.md

passsword -> password

* Update README.md

* feat: close ChatGPTNextWeb#3031 user can set larger font size

* merge upstream/main to main (#6)

* Update chat.tsx

* Update chat.tsx

* [ADDED] MacOS detect

* [FIXED] now the default key should be CMD on MacOS

* [FIXED] now it should detects all macintosh

* UI Page [Auth Page]

[+] feat(auth.tsx): add support for resetting access token in resetAccessCode function
[+] fix(auth.tsx): fix formatting issue in resetAccessCode function
[+] feat(locales): add support for sub tips in Auth component for multiple languages :
  - Add sub tips in Arabic locale (ar.ts)
  - Add sub tips in Bengali locale (bn.ts)
  - Add sub tips in Chinese locale (cn.ts)
  - Add sub tips in English locale (en.ts)
  - Add sub tips in Indonesian locale (id.ts)

* Feat & Fix UI Page [Auth Page]

[+] feat(auth.tsx): add goChat function to navigate to chat page
[+] fix(auth.tsx): change onClick event from goHome to goChat

* Refactor Locale Indonesia

[+] refactor(id.ts): remove unused import and isApp variable
[+] fix(id.ts): update Unauthorized error message

* Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field

* Client App [Notification]

[+] feat(global.d.ts): add support for window.__TAURI__.notification methods
[+] feat(update.ts): add notification for new version availability
[+] fix(Cargo.toml): add tauri feature "notification-all" to enable notifications
[+] fix(tauri.conf.json): enable all notification features in tauri configuration

* Client App Fix Issue [Bug] 'export' button does not work ChatGPTNextWeb#2884

[+] fix(exporter.tsx): add async keyword to download function
[+] feat(exporter.tsx): add support for saving image file using window.__TAURI__ API
[+] feat(global.d.ts): add types for window.__TAURI__ API methods
[+] feat(locales): add translations for download success and failure messages
[+] feat(sync.ts): add support for generating backup file name with date and time
[+] fix(utils.ts): add async keyword to downloadAs function and add support for saving file using window.__TAURI__ API

* Fix & Feat Client App [Notification]

[+] fix(update.ts): remove unnecessary notification sending when permission is not granted
[+] feat(update.ts): add notification for already up to date version

* Feat & Fix "Client App [Notification]"

[+] feat(update.ts): add support for localization in update notifications
[+] fix(update.ts): add missing semicolon in useUpdateStore function

* Change log

-   config.ts
    -   line 72 remove type confirmation of x as x always has type 'number'
    -   line 135 remove redundant local variable
-   chat.ts
    -   delete unused import

* Change log

-   config.ts
    -   line 72: remove type confirmation of x as x always has type 'number'
    -   line 135: remove the redundant local variable
-   chat.ts
    -   delete the unused import

* Improve tw locale

* Update tauri.conf.json

* 修改界面

似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。

* Update tauri.conf.json

* fix: ChatGPTNextWeb#2981 full screen button not works

* Fix type in sync.ts

Simple typo fix.

* Refactor Mask UI Page [Masks]

[+] refactor(mask.tsx): refactor simple search to be case-insensitive

* 提供同步聊天记录教程,同时翻译多国语言

* Update constant.ts

* 已拆分单个文件、翻译多国语言版本

* docs: fix typo in app/masks/en.ts

* fix serviceWorker cache

* Fix typo in README.md

passsword -> password

* Update README.md

* feat: close ChatGPTNextWeb#3031 user can set larger font size

* Update synchronise-chat-logs-cn.md

* Update README_CN.md

* Update README_KO.md

* Update README_KO.md

* Revert "fix serviceWorker cache: auto caching files by workbox"

---------

Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>

---------

Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: fengsh <[email protected]>

* Update mask.tsx

* merge main to develop/ChatGSE-Next (#8)

* Update chat.tsx

* Update chat.tsx

* [ADDED] MacOS detect

* [FIXED] now the default key should be CMD on MacOS

* [FIXED] now it should detects all macintosh

* UI Page [Auth Page]

[+] feat(auth.tsx): add support for resetting access token in resetAccessCode function
[+] fix(auth.tsx): fix formatting issue in resetAccessCode function
[+] feat(locales): add support for sub tips in Auth component for multiple languages :
  - Add sub tips in Arabic locale (ar.ts)
  - Add sub tips in Bengali locale (bn.ts)
  - Add sub tips in Chinese locale (cn.ts)
  - Add sub tips in English locale (en.ts)
  - Add sub tips in Indonesian locale (id.ts)

* Feat & Fix UI Page [Auth Page]

[+] feat(auth.tsx): add goChat function to navigate to chat page
[+] fix(auth.tsx): change onClick event from goHome to goChat

* Refactor Locale Indonesia

[+] refactor(id.ts): remove unused import and isApp variable
[+] fix(id.ts): update Unauthorized error message

* Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field

* Client App [Notification]

[+] feat(global.d.ts): add support for window.__TAURI__.notification methods
[+] feat(update.ts): add notification for new version availability
[+] fix(Cargo.toml): add tauri feature "notification-all" to enable notifications
[+] fix(tauri.conf.json): enable all notification features in tauri configuration

* Client App Fix Issue [Bug] 'export' button does not work ChatGPTNextWeb#2884

[+] fix(exporter.tsx): add async keyword to download function
[+] feat(exporter.tsx): add support for saving image file using window.__TAURI__ API
[+] feat(global.d.ts): add types for window.__TAURI__ API methods
[+] feat(locales): add translations for download success and failure messages
[+] feat(sync.ts): add support for generating backup file name with date and time
[+] fix(utils.ts): add async keyword to downloadAs function and add support for saving file using window.__TAURI__ API

* Fix & Feat Client App [Notification]

[+] fix(update.ts): remove unnecessary notification sending when permission is not granted
[+] feat(update.ts): add notification for already up to date version

* Feat & Fix "Client App [Notification]"

[+] feat(update.ts): add support for localization in update notifications
[+] fix(update.ts): add missing semicolon in useUpdateStore function

* Change log

-   config.ts
    -   line 72 remove type confirmation of x as x always has type 'number'
    -   line 135 remove redundant local variable
-   chat.ts
    -   delete unused import

* Change log

-   config.ts
    -   line 72: remove type confirmation of x as x always has type 'number'
    -   line 135: remove the redundant local variable
-   chat.ts
    -   delete the unused import

* Improve tw locale

* Update tauri.conf.json

* 修改界面

似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。

* Update tauri.conf.json

* fix: ChatGPTNextWeb#2981 full screen button not works

* Fix type in sync.ts

Simple typo fix.

* Refactor Mask UI Page [Masks]

[+] refactor(mask.tsx): refactor simple search to be case-insensitive

* 提供同步聊天记录教程,同时翻译多国语言

* Update constant.ts

* 已拆分单个文件、翻译多国语言版本

* docs: fix typo in app/masks/en.ts

* fix serviceWorker cache

* Fix typo in README.md

passsword -> password

* Update README.md

* feat: close ChatGPTNextWeb#3031 user can set larger font size

* Update synchronise-chat-logs-cn.md

* Update README_CN.md

* Update README_KO.md

* Update README_KO.md

* Revert "fix serviceWorker cache: auto caching files by workbox"

* merge upstream/main to main (#6)

* Update chat.tsx

* Update chat.tsx

* [ADDED] MacOS detect

* [FIXED] now the default key should be CMD on MacOS

* [FIXED] now it should detects all macintosh

* UI Page [Auth Page]

[+] feat(auth.tsx): add support for resetting access token in resetAccessCode function
[+] fix(auth.tsx): fix formatting issue in resetAccessCode function
[+] feat(locales): add support for sub tips in Auth component for multiple languages :
  - Add sub tips in Arabic locale (ar.ts)
  - Add sub tips in Bengali locale (bn.ts)
  - Add sub tips in Chinese locale (cn.ts)
  - Add sub tips in English locale (en.ts)
  - Add sub tips in Indonesian locale (id.ts)

* Feat & Fix UI Page [Auth Page]

[+] feat(auth.tsx): add goChat function to navigate to chat page
[+] fix(auth.tsx): change onClick event from goHome to goChat

* Refactor Locale Indonesia

[+] refactor(id.ts): remove unused import and isApp variable
[+] fix(id.ts): update Unauthorized error message

* Fix & Refactor UI Page [Auth Page]

[+] fix(auth.tsx): fix conditional rendering of token input field
[+] refactor(auth.tsx): improve code readability by using conditional rendering for token input field

* Client App [Notification]

[+] feat(global.d.ts): add support for window.__TAURI__.notification methods
[+] feat(update.ts): add notification for new version availability
[+] fix(Cargo.toml): add tauri feature "notification-all" to enable notifications
[+] fix(tauri.conf.json): enable all notification features in tauri configuration

* Client App Fix Issue [Bug] 'export' button does not work ChatGPTNextWeb#2884

[+] fix(exporter.tsx): add async keyword to download function
[+] feat(exporter.tsx): add support for saving image file using window.__TAURI__ API
[+] feat(global.d.ts): add types for window.__TAURI__ API methods
[+] feat(locales): add translations for download success and failure messages
[+] feat(sync.ts): add support for generating backup file name with date and time
[+] fix(utils.ts): add async keyword to downloadAs function and add support for saving file using window.__TAURI__ API

* Fix & Feat Client App [Notification]

[+] fix(update.ts): remove unnecessary notification sending when permission is not granted
[+] feat(update.ts): add notification for already up to date version

* Feat & Fix "Client App [Notification]"

[+] feat(update.ts): add support for localization in update notifications
[+] fix(update.ts): add missing semicolon in useUpdateStore function

* Change log

-   config.ts
    -   line 72 remove type confirmation of x as x always has type 'number'
    -   line 135 remove redundant local variable
-   chat.ts
    -   delete unused import

* Change log

-   config.ts
    -   line 72: remove type confirmation of x as x always has type 'number'
    -   line 135: remove the redundant local variable
-   chat.ts
    -   delete the unused import

* Improve tw locale

* Update tauri.conf.json

* 修改界面

似乎这里引入了一个逻辑判断错误,会导致打包之后的界面变宽变高。

* Update tauri.conf.json

* fix: ChatGPTNextWeb#2981 full screen button not works

* Fix type in sync.ts

Simple typo fix.

* Refactor Mask UI Page [Masks]

[+] refactor(mask.tsx): refactor simple search to be case-insensitive

* 提供同步聊天记录教程,同时翻译多国语言

* Update constant.ts

* 已拆分单个文件、翻译多国语言版本

* docs: fix typo in app/masks/en.ts

* fix serviceWorker cache

* Fix typo in README.md

passsword -> password

* Update README.md

* feat: close ChatGPTNextWeb#3031 user can set larger font size

* Update synchronise-chat-logs-cn.md

* Update README_CN.md

* Update README_KO.md

* Update README_KO.md

* Revert "fix serviceWorker cache: auto caching files by workbox"

---------

Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>

* Feat Models [GPT-4] [GPT-3.5] [128K context]

[+] feat(constant.ts): add new models to DEFAULT_MODELS array

* Fix Typo [GPT-4]

[+] fix(constant.ts): fix typo in model name, change "ggpt-4-1106-preview" to "gpt-4-1106-preview"

* Refactor KnowledgeCutoff

[+] fix(constant.ts): update DEFAULT_SYSTEM_TEMPLATE to include knowledgeCutoff and time variables
[+] feat(chat.ts): add support for injecting system prompts based on model configuration

* fix: ChatGPTNextWeb#3016 disable sidebar transition on ios

* fix: ChatGPTNextWeb#3152 system prompt should be injected

* feat: default disable balance query

* feat: close ChatGPTNextWeb#2908 allow to disable parse settings from link

* fixup

* feat: sort model by name

* Update tauri.conf.json

* docs: up to date

* docs: fix typo in ChatGPTNextWeb#3171

* Update cloudflare-pages-cn.md

cloudflare 构建命令

* feat: close ChatGPTNextWeb#2954 chat summary should be copyable

* fix: ChatGPTNextWeb#3174 should prompt to confirm to delete chat

* feat: close ChatGPTNextWeb#3187 use CUSTOM_MODELS to control model list

* fix: ChatGPTNextWeb#3186 enable max_tokens in chat payload

* fix: ChatGPTNextWeb#3192 use smaller max_tokens as default

* fix: ChatGPTNextWeb#3196 3.5-turbo-1106 should use old cutoff date

* feat: wont send max_tokens

* feat: close ChatGPTNextWeb#935 add azure support

* fixup

* doc: update azure env vars

* Update README.md

* Update README.md

* fix: ChatGPTNextWeb#3207 ensure corner case

* Update tauri.conf.json

* fixbug

* Update constant.ts

* Update README_CN.md

* feat: ChatGPTNextWeb#3224 auto switch to first avaliable model

* feat: CUSTOM_MODELS support mapper

* chore: update doc for mapped `CUSTOM_MODELS`

* feat: close ChatGPTNextWeb#3222 share message list should start from clear context index

* Feat UI/UX Page Local Language [Exporter Message]

[+] fix(exporter.tsx): update the text in the ExportMessageModal component to use the localized title from the locale file
[+] feat(cn.ts, en.ts, id.ts): add localized title for the Exporter Description in the respective locale files

* Fix UI/UX Page Local Language [Exporter Message]

fix(locales): fix incorrect description title in en.ts and id.ts
 - Change "Only messages after clearing the context will be displayed" to "Only messages before clearing the context will be displayed" in en.ts
 - Change "Hanya pesan setelah menghapus konteks yang akan ditampilkan" to "Hanya pesan sebelum menghapus konteks yang akan ditampilkan" in id.ts

* Revert "Fix UI/UX Page Local Language [Exporter Message]"

This reverts commit a46f081.
Reason : better after instead of before

* UI (model selection): hide unavailable model options

* fix: ChatGPTNextWeb#3189 should correct math eq in exporter

* fix: ChatGPTNextWeb#2841 dollar sign conflict with latex math

* fix: ChatGPTNextWeb#3241 should not ensure openai url non-empty

* Update README.md

* chore(deps-dev): bump @types/node from 20.3.3 to 20.9.0

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.3.3 to 20.9.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps-dev): bump @types/spark-md5 from 3.0.2 to 3.0.4

Bumps [@types/spark-md5](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/spark-md5) from 3.0.2 to 3.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/spark-md5)

---
updated-dependencies:
- dependency-name: "@types/spark-md5"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump mermaid from 10.3.1 to 10.6.1

Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.3.1 to 10.6.1.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](mermaid-js/mermaid@v10.3.1...v10.6.1)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump emoji-picker-react from 4.5.1 to 4.5.15

Bumps [emoji-picker-react](https://github.com/ealush/emoji-picker-react) from 4.5.1 to 4.5.15.
- [Release notes](https://github.com/ealush/emoji-picker-react/releases)
- [Commits](https://github.com/ealush/emoji-picker-react/commits)

---
updated-dependencies:
- dependency-name: emoji-picker-react
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump nanoid from 4.0.2 to 5.0.3

Bumps [nanoid](https://github.com/ai/nanoid) from 4.0.2 to 5.0.3.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](ai/nanoid@4.0.2...5.0.3)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix UI/UX Page [Settings]

[+] fix(settings.tsx): fix condition to show balance query in settings component
[+] fix(settings.tsx): add condition to hide balance query for app clients

* fix: ChatGPTNextWeb#3275 refuse on server side if hide user api key

* config: exclude hkg1 from the deployment regions of the edge function

* Update tauri.conf.json

* chore: update gh actions nodejs version to 18

* config: disable ip forward in vercel json config

* Update vercel.json

* Update vercel.json

* Translation of the application into Brazilian Portuguese

* Update vercel.json

* feat: animate streaming response to make more smooth

* feat: close ChatGPTNextWeb#3301 enable or diable default models with -all / +all

* feat: close ChatGPTNextWeb#3304 use `=` instead of `:` to map model name in CUSTOM_MODELS

* feat: close ChatGPTNextWeb#3300 support multiple api keys

* feat: better animation speed

* fix(locales): type error in pt.ts

* fix(CUSTOM_MODELS):ChatGPTNextWeb#3349 Dependency chatStore otherwise the session and view will not updated

* Update README.md

* Update README.md

* Fix UI/UX Page Chats [Memory Prompt] [Stored Local Storage]

- [+] fix(chat.ts): update the memory prompt in onFinish callback
- [+] feat(chat.ts): update the current session with lastSummarizeIndex and memoryPrompt

* Fix Api Common [Server Side] [Console Log]

- [+] fix(common.ts): fix console.log statement for [Org ID] to handle undefined value

* Fixup Api Common [Server Side] [Console Log]

- [+] fix(common.ts): fix condition to check if serverConfig.openaiOrgId is not undefined

* Chore Docs (README.md)

- [+] chore(README.md): add support for Korean and Indonesian languages

* Fix & Refactor UI/UX Page [Auth]

- [+] fix(auth.tsx): fix condition to set custom endpoint to true if it's app
- [+] refactor(auth.tsx): update accessStore to set useCustomConfig to true

* Feat UI/UX Page [Settings]

- [+] feat(settings.tsx): set useCustomConfig to true if clientConfig.isApp is truthy

* Revert "Fix & Refactor UI/UX Page [Auth]"

This reverts commit d76e744.

Reason: Move to commits bf5e7aa

* Fix & Refactor UI/UX Page [Settings]

- [+] fix(settings.tsx): fix conditional rendering of ListItem based on clientConfig.isApp
- [+] refactor(settings.tsx): improve readability of conditional rendering code

* Update README.md

* Update README_CN.md

* update .env.template and docker-compose.yml

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: fengsh <[email protected]>
Co-authored-by: 安忆 <[email protected]>
Co-authored-by: bob <[email protected]>
Co-authored-by: Ensteinjun <[email protected]>
Co-authored-by: nanaya <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric-2369 <[email protected]>
Co-authored-by: Yuri Filipe <[email protected]>
Co-authored-by: durian <[email protected]>

* add biochatter-server code (#9)

Co-authored-by: fengsh <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: fengsh <[email protected]>
Co-authored-by: Algorithm5838 <[email protected]>
Co-authored-by: Yifei Zhang <[email protected]>
Co-authored-by: Eric R <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: KeithHello <[email protected]>
Co-authored-by: Peter Dave Hello <[email protected]>
Co-authored-by: GH Action - Upstream Sync <[email protected]>
Co-authored-by: Kong Gaowen <[email protected]>
Co-authored-by: Jason O'Gray <[email protected]>
Co-authored-by: H0llyW00dzZ <[email protected]>
Co-authored-by: mcheping520 <[email protected]>
Co-authored-by: Surav Shrestha <[email protected]>
Co-authored-by: Jesse <[email protected]>
Co-authored-by: Ikko Eltociear Ashimine <[email protected]>
Co-authored-by: 安忆 <[email protected]>
Co-authored-by: bob <[email protected]>
Co-authored-by: Ensteinjun <[email protected]>
Co-authored-by: nanaya <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric-2369 <[email protected]>
Co-authored-by: Yuri Filipe <[email protected]>
Co-authored-by: durian <[email protected]>
  • Loading branch information
1 parent 92a5297 commit 3f2de26
Show file tree
Hide file tree
Showing 43 changed files with 3,039 additions and 1,165 deletions.
8 changes: 8 additions & 0 deletions .bioserver.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# If .bioserver.env doesn't provide OPENAI setup, customers need to set OPENAI API key in website
# OPENAI_API_TYPE=
# OPENAI_DEPLOYMENT_NAME=
# OPENAI_MODEL=
# OPENAI_API_VERSION=
# OPENAI_API_BASE=
# OPENAI_API_KEY=

21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ignore development-specific files and directories
node_modules
.next
out
.cache
.env.local
.env.development.local
.env.test.local
.env.production.local

# Ignore build artifacts
.DS_Store
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Ignore local development files
venv/
.env
*.env
34 changes: 2 additions & 32 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@

# Your openai api key. (required)
OPENAI_API_KEY=sk-xxxx

# Access passsword, separated by comma. (optional)
CODE=your-password

# You can start service behind a proxy
PROXY_URL=http://localhost:7890

# Override openai api request base url. (optional)
# Default: https://api.openai.com
# Examples: http://your-openai-proxy.com
BASE_URL=
# biochatter server url. (required)
BASE_URL= http://127.0.0.1:5000

# Specify OpenAI organization ID.(optional)
# Default: Empty
OPENAI_ORG_ID=

# (optional)
# Default: Empty
# If you do not want users to use GPT-4, set this value to 1.
DISABLE_GPT4=

# (optional)
# Default: Empty
# If you do not want users to input their own API key, set this value to 1.
HIDE_USER_API_KEY=

# (optional)
# Default: Empty
# If you do want users to query balance, set this value to 1.
ENABLE_BALANCE_QUERY=

# (optional)
# Default: Empty
# If you want to disable parse settings from url, set this value to 1.
DISABLE_FAST_LINK=
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
*.env

# vercel
.vercel
Expand All @@ -43,4 +44,12 @@ dev
.env

*.key
*.key.pub
*.key.pub

# logs
logs/

# python ignore files
__pycache__/
*.py[cod]
*$py.class
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ WORKDIR /app

COPY package.json yarn.lock ./

RUN yarn config set registry 'https://registry.npmmirror.com/'
RUN yarn install

FROM base AS builder
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ bash <(curl -s https://raw.githubusercontent.com/Yidadaa/ChatGPT-Next-Web/main/s

⚠️ 注意:如果你安装过程中遇到了问题,请使用 docker 部署。


## 鸣谢

### 捐赠者
Expand Down
27 changes: 23 additions & 4 deletions app/api/openai/[...path]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ async function handle(

const authResult = auth(req);
if (authResult.error) {
return NextResponse.json(authResult, {
status: 401,
});
// return NextResponse.json(authResult, {
// status: 401,
// });
console.log("Invalide OpenAI Key!");
}

try {
Expand All @@ -75,4 +76,22 @@ export const GET = handle;
export const POST = handle;

export const runtime = "edge";
export const preferredRegion = ['arn1', 'bom1', 'cdg1', 'cle1', 'cpt1', 'dub1', 'fra1', 'gru1', 'hnd1', 'iad1', 'icn1', 'kix1', 'lhr1', 'pdx1', 'sfo1', 'sin1', 'syd1'];
export const preferredRegion = [
"arn1",
"bom1",
"cdg1",
"cle1",
"cpt1",
"dub1",
"fra1",
"gru1",
"hnd1",
"iad1",
"icn1",
"kix1",
"lhr1",
"pdx1",
"sfo1",
"sin1",
"syd1",
];
2 changes: 1 addition & 1 deletion app/client/platforms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ChatGPTApi implements LLMApi {

console.log("[Request] openai payload: ", requestPayload);

const shouldStream = !!options.config.stream;
const shouldStream = false; // !!options.config.stream; //
const controller = new AbortController();
options.onController?.(controller);

Expand Down
4 changes: 2 additions & 2 deletions app/components/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ export function ImagePreviewer(props: {
</div>

<div>
<div className={styles["main-title"]}>ChatGPT Next Web</div>
<div className={styles["main-title"]}>ChatGSE Next Web</div>
<div className={styles["sub-title"]}>
github.com/Yidadaa/ChatGPT-Next-Web
github.com/fengsh27/ChatGPT-Next-Web
</div>
<div className={styles["icons"]}>
<ExportAvatar avatar={config.avatar} />
Expand Down
3 changes: 2 additions & 1 deletion app/components/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function Screen() {
const isHome = location.pathname === Path.Home;
const isAuth = location.pathname === Path.Auth;
const isMobileScreen = useMobileScreen();
const shouldTightBorder = getClientConfig()?.isApp || (config.tightBorder && !isMobileScreen);
const shouldTightBorder =
getClientConfig()?.isApp || (config.tightBorder && !isMobileScreen);

useEffect(() => {
loadAsyncGoogleFont();
Expand Down
3 changes: 2 additions & 1 deletion app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ export function Settings() {
navigate(Path.Home);
}
};
if (clientConfig?.isApp) { // Force to set custom endpoint to true if it's app
if (clientConfig?.isApp) {
// Force to set custom endpoint to true if it's app
accessStore.update((state) => {
state.useCustomConfig = true;
});
Expand Down
2 changes: 1 addition & 1 deletion app/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function SideBar(props: { className?: string }) {
>
<div className={styles["sidebar-header"]} data-tauri-drag-region>
<div className={styles["sidebar-title"]} data-tauri-drag-region>
ChatGPT Next
ChatGSE Next
</div>
<div className={styles["sidebar-sub-title"]}>
Build your own AI assistant.
Expand Down
2 changes: 1 addition & 1 deletion app/constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const OWNER = "Yidadaa";
export const OWNER = "fengsh27";
export const REPO = "ChatGPT-Next-Web";
export const REPO_URL = `https://github.com/${OWNER}/${REPO}`;
export const ISSUE_URL = `https://github.com/${OWNER}/${REPO}/issues`;
Expand Down
2 changes: 1 addition & 1 deletion app/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare interface Window {
fs: {
writeBinaryFile(path: string, data: Uint8Array): Promise<void>;
};
notification:{
notification: {
requestPermission(): Promise<Permission>;
isPermissionGranted(): Promise<boolean>;
sendNotification(options: string | Options): void;
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getClientConfig } from "./config/client";
import { type Metadata } from "next";

export const metadata: Metadata = {
title: "ChatGPT Next Web",
title: "ChatGSE Next",
description: "Your personal ChatGPT Chat Bot.",
viewport: {
width: "device-width",
Expand All @@ -18,7 +18,7 @@ export const metadata: Metadata = {
{ media: "(prefers-color-scheme: dark)", color: "#151515" },
],
appleWebApp: {
title: "ChatGPT Next Web",
title: "ChatGSE Next",
statusBarStyle: "default",
},
};
Expand Down
6 changes: 3 additions & 3 deletions app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ const cn = {
Config: "配置",
},
Exporter: {
Description : {
Title: "只有清除上下文之后的消息会被展示"
},
Description: {
Title: "只有清除上下文之后的消息会被展示",
},
Model: "模型",
Messages: "消息",
Topic: "主题",
Expand Down
4 changes: 2 additions & 2 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ const en: LocaleType = {
},
Exporter: {
Description: {
Title: "Only messages after clearing the context will be displayed"
},
Title: "Only messages after clearing the context will be displayed",
},
Model: "Model",
Messages: "Messages",
Topic: "Topic",
Expand Down
4 changes: 2 additions & 2 deletions app/locales/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ const id: PartialLocaleType = {
},
Exporter: {
Description: {
Title: "Hanya pesan setelah menghapus konteks yang akan ditampilkan"
},
Title: "Hanya pesan setelah menghapus konteks yang akan ditampilkan",
},
Model: "Model",
Messages: "Pesan",
Topic: "Topik",
Expand Down
39 changes: 39 additions & 0 deletions app/masks/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,43 @@ export const EN_MASKS: BuiltinMask[] = [
builtin: true,
createdAt: 1688899480413,
},
{
avatar: "1f977",
name: "Biomedical researcher assistant",
context: [
{
id: "biomedical-researcher-assistant-1",
role: "user",
content: "You are an assistant to a biomedical researcher.",
date: "",
},
{
id: "biomedical-researcher-assistant-2",
role: "user",
content:
"Your role is to contextualise the user's findings with biomedical background knowledge. If provided with a list, please give granular feedback about the individual entities, your knowledge about them, and what they may mean in the context of the research.",
date: "",
},
{
id: "biomedical-researcher-assistant-3",
role: "user",
content:
"You can ask the user to provide explanations and more background at any time, for instance on the treatment a patient has received, or the experimental background. But for now, wait for the user to ask a question.",
date: "",
},
],
modelConfig: {
model: "gpt-4",
temperature: 0.7,
max_tokens: 2000,
presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true,
historyMessageCount: 4,
compressMessageLengthThreshold: 2000,
},
lang: "en",
builtin: true,
createdAt: 1697222692762,
},
];
2 changes: 1 addition & 1 deletion app/masks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ export const BUILTIN_MASK_STORE = {
},
};

export const BUILTIN_MASKS: BuiltinMask[] = [...CN_MASKS, ...EN_MASKS].map(
export const BUILTIN_MASKS: BuiltinMask[] = [/*...CN_MASKS,*/ ...EN_MASKS].map(
(m) => BUILTIN_MASK_STORE.add(m),
);
12 changes: 9 additions & 3 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { v4 as uuidv4 } from "uuid";
import { trimTopic } from "../utils";

import Locale, { getLang } from "../locales";
Expand All @@ -18,6 +19,8 @@ import { estimateTokenLength } from "../utils/token";
import { nanoid } from "nanoid";
import { createPersistStore } from "../utils/store";

const generateUniqId = () => uuidv4();

export type ChatMessage = RequestMessage & {
date: string;
streaming?: boolean;
Expand Down Expand Up @@ -64,7 +67,7 @@ export const BOT_HELLO: ChatMessage = createMessage({

function createEmptySession(): ChatSession {
return {
id: nanoid(),
id: generateUniqId(),
topic: DEFAULT_TOPIC,
memoryPrompt: "",
messages: [],
Expand Down Expand Up @@ -406,6 +409,9 @@ export const useChatStore = createPersistStore(
const longTermMemoryPrompts = shouldSendLongTermMemory
? [get().getMemoryPrompt()]
: [];
console.log(
`[fengsh] shouldSendLongTermMemory: ${shouldSendLongTermMemory}`,
);
const longTermMemoryStartIndex = session.lastSummarizeIndex;

// short term memory
Expand Down Expand Up @@ -549,7 +555,7 @@ export const useChatStore = createPersistStore(
),
config: {
...modelConfig,
stream: true,
stream: false,
model: getSummarizeModel(session.mask.modelConfig.model),
},
onUpdate(message) {
Expand Down Expand Up @@ -618,7 +624,7 @@ export const useChatStore = createPersistStore(
if (version < 3) {
// migrate id to nanoid
newState.sessions.forEach((s) => {
s.id = nanoid();
s.id = generateUniqId();
s.messages.forEach((m) => (m.id = nanoid()));
});
}
Expand Down
6 changes: 4 additions & 2 deletions app/store/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ export const useSyncStore = createPersistStore(
export() {
const state = getLocalAppState();
const datePart = isApp
? `${new Date().toLocaleDateString().replace(/\//g, '_')} ${new Date().toLocaleTimeString().replace(/:/g, '_')}`
: new Date().toLocaleString();
? `${new Date().toLocaleDateString().replace(/\//g, "_")} ${new Date()
.toLocaleTimeString()
.replace(/:/g, "_")}`
: new Date().toLocaleString();

const fileName = `Backup-${datePart}.json`;
downloadAs(JSON.stringify(state), fileName);
Expand Down
Loading

0 comments on commit 3f2de26

Please sign in to comment.