mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
commit
780cdbc152
6
.github/workflows/dockerToHub.yml
vendored
6
.github/workflows/dockerToHub.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
github-server-url: 'https://gh.sivpn.cn'
|
||||
- name: build and deploy to Docker Hub
|
||||
run: |
|
||||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login registry.gitlab.si.icu -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login registry.si.icu -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
echo "${{ secrets.DOCKER_ENV }}" > .env
|
||||
- name: Get current date
|
||||
run: echo "DATE_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||
@ -35,8 +35,8 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
registry.gitlab.si.icu/sijinhui/chatgpt-next-web:latest
|
||||
registry.gitlab.si.icu/sijinhui/chatgpt-next-web:${{ env.DATE_TAG }}
|
||||
registry.si.icu/sijinhui/chatgpt-next-web:latest
|
||||
registry.si.icu/sijinhui/chatgpt-next-web:${{ env.DATE_TAG }}
|
||||
- name: clean build history
|
||||
run: |
|
||||
yes | docker system prune --filter "until=720h"
|
||||
|
@ -77,16 +77,24 @@ export class ErnieApi implements LLMApi {
|
||||
|
||||
async chat(options: ChatOptions) {
|
||||
const messages = options.messages.map((v) => ({
|
||||
role: v.role,
|
||||
// "error_code": 336006, "error_msg": "the role of message with even index in the messages must be user or function",
|
||||
role: v.role === "system" ? "user" : v.role,
|
||||
content: getMessageTextContent(v),
|
||||
}));
|
||||
|
||||
// "error_code": 336006, "error_msg": "the length of messages must be an odd number",
|
||||
if (messages.length % 2 === 0) {
|
||||
messages.unshift({
|
||||
role: "user",
|
||||
content: " ",
|
||||
});
|
||||
if (messages.at(0)?.role === "user") {
|
||||
messages.splice(1, 0, {
|
||||
role: "assistant",
|
||||
content: " ",
|
||||
});
|
||||
} else {
|
||||
messages.unshift({
|
||||
role: "user",
|
||||
content: " ",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const modelConfig = {
|
||||
|
@ -91,8 +91,9 @@ export class HunyuanApi implements LLMApi {
|
||||
|
||||
async chat(options: ChatOptions) {
|
||||
const visionModel = isVisionModel(options.config.model);
|
||||
const messages = options.messages.map((v) => ({
|
||||
role: v.role,
|
||||
const messages = options.messages.map((v, index) => ({
|
||||
// "Messages 中 system 角色必须位于列表的最开始"
|
||||
role: index !== 0 && v.role === "system" ? "user" : v.role,
|
||||
content: visionModel ? v.content : getMessageTextContent(v),
|
||||
}));
|
||||
|
||||
|
@ -3,7 +3,7 @@ services:
|
||||
chatgpt-next-web:
|
||||
container_name: chatgpt-next-web
|
||||
restart: always
|
||||
image: registry.gitlab.si.icu/sijinhui/chatgpt-next-web
|
||||
image: registry.si.icu/sijinhui/chatgpt-next-web
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
Loading…
Reference in New Issue
Block a user