diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4e8f1a0e..b22ad600 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -6,7 +6,7 @@ on: - dev jobs: - github: + x86-64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 @@ -26,3 +26,32 @@ jobs: uses: actions-hub/docker@master with: args: push weaigc/bingo:latest + arm: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build :latest + run: docker build -t weaigc/bingo:arm -f ./docker/arm . + - + name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + dockerfile: ./docker/arm + platforms: linux/arm64 + push: true + tags: weaigc/bingo:arm diff --git a/.github/workflows/huggingface.yml b/.github/workflows/huggingface.yml index 2287d307..0deb1bd5 100644 --- a/.github/workflows/huggingface.yml +++ b/.github/workflows/huggingface.yml @@ -22,5 +22,7 @@ jobs: cd huggingface git config user.name hf4all git config user.email hf4all@gmail.com - git commit -am "auto build" --amend + echo "Last build time $(date)" > BUILD_INFO.txt + git add BUILD_INFO.txt + git commit -am "auto build" git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$SPACE_NAME main -f diff --git a/docker/arm b/docker/arm new file mode 100644 index 00000000..a8e9f4ab --- /dev/null +++ b/docker/arm @@ -0,0 +1,26 @@ +FROM arm64v8/node:18-bookworm + + +ARG DEBIAN_FRONTEND=noninteractive + +ENV BING_HEADER "" + +# Set the working directory to the user's home directory +WORKDIR $HOME/app + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json $HOME/app/ + +RUN npm install + +# Copy the current directory contents into the container at $HOME/app setting the owner to the user +COPY . $HOME/app/ + +RUN npm run build && rm -rf src + +ENV PORT 7860 +EXPOSE 7860 + +CMD npm start diff --git a/src/lib/bots/bing/index.ts b/src/lib/bots/bing/index.ts index e9df5bd9..bc40c1d1 100644 --- a/src/lib/bots/bing/index.ts +++ b/src/lib/bots/bing/index.ts @@ -23,71 +23,71 @@ type Params = SendMessageParams<{ bingConversationStyle: BingConversationStyle, const getOptionSets = (conversationStyle: BingConversationStyle) => { return { [BingConversationStyle.Creative]: [ - "nlu_direct_response_filter", - "deepleo", - "disable_emoji_spoken_text", - "responsible_ai_policy_235", - "enablemm", - "dv3sugg", - "machine_affinity", - "autosave", - "iyxapbing", - "iycapbing", - "h3imaginative", - "adsredirecturl", - "bof107v2", - "streamw", - "rctechalwlst", - "agicert", - "cdxedtgnd", - "eredirecturl", - "clgalileo", - "gencontentv3" + 'nlu_direct_response_filter', + 'deepleo', + 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', + 'enablemm', + 'dv3sugg', + 'machine_affinity', + 'autosave', + 'iyxapbing', + 'iycapbing', + 'h3imaginative', + 'clgalileo', + 'gencontentv3', + 'adsredirecturl', + 'bof107v2', + 'streamw', + 'rctechalwlst', + 'agicert', + 'cdxedtgnd', + 'eredirecturl' ], [BingConversationStyle.Balanced]: [ - "nlu_direct_response_filter", - "deepleo", - "disable_emoji_spoken_text", - "responsible_ai_policy_235", - "enablemm", - "dv3sugg", - "machine_affinity", - "autosave", - "iyxapbing", - "iycapbing", - "galileo", - "adsredirecturl", - "bof107v2", - "streamw", - "rctechalwlst", - "agicert", - "cdxedtgnd", - "eredirecturl", - "saharagenconv5", - "fluxhint", - "glfluxv13" + 'nlu_direct_response_filter', + 'deepleo', + 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', + 'enablemm', + 'dv3sugg', + 'machine_affinity', + 'autosave', + 'iyxapbing', + 'iycapbing', + 'galileo', + 'adsredirecturl', + 'bof107v2', + 'streamw', + 'rctechalwlst', + 'agicert', + 'cdxedtgnd', + 'eredirecturl', + 'saharagenconv5', + 'fluxhint', + 'glfluxv13' ], [BingConversationStyle.Precise]: [ - "nlu_direct_response_filter", - "deepleo", - "disable_emoji_spoken_text", - "responsible_ai_policy_235", - "enablemm", - "dv3sugg", - "machine_affinity", - "autosave", - "iyxapbing", - "iycapbing", - "h3precise", - "adsredirecturl", - "bof107v2", - "streamw", - "rctechalwlst", - "agicert", - "cdxedtgnd", - "eredirecturl", - "clgalileo", - "gencontentv3" + 'nlu_direct_response_filter', + 'deepleo', + 'disable_emoji_spoken_text', + 'responsible_ai_policy_235', + 'enablemm', + 'dv3sugg', + 'machine_affinity', + 'autosave', + 'iyxapbing', + 'iycapbing', + 'h3precise', + 'adsredirecturl', + 'bof107v2', + 'streamw', + 'rctechalwlst', + 'agicert', + 'cdxedtgnd', + 'eredirecturl', + 'clgalileo', + 'gencontentv3' ] }[conversationStyle] } @@ -128,30 +128,31 @@ export class BingWebBot { 'InternalLoaderMessage', 'Progress', 'RenderCardRequest', + 'AdsQuery', 'SemanticSerp', 'GenerateContentQuery', 'SearchQuery', ], sliceIds: [ - "629adsredir", - "edi", - "divkorbl2p", - "wrapuxslimc", - "wrapnoins", - "sydconfigoptt", - "0731ziv2s0", - "0824cntors0", - "816bof107v2", - "806log2sphs0", - "0518logoss0", - "0529streamw", - "streamw", - "178gentech", - "824fluxhi52s0", - "0825agicert", - "804cdxedtgd", - "727udtupms0", - "727nrprdrt5" + '629adsredir', + 'edi', + 'divkorbl2p', + 'wrapuxslimc', + 'wrapnoins', + 'sydconfigoptt', + '0731ziv2s0', + '0824cntors0', + '816bof107v2', + '806log2sphs0', + '0518logoss0', + '0529streamw', + 'streamw', + '178gentech', + '824fluxhi52s0', + '0825agicert', + '804cdxedtgd', + '727udtupms0', + '727nrprdrt5' ], isStartOfSession: conversation.invocationId === 0, message: { @@ -164,6 +165,8 @@ export class BingWebBot { conversationId: conversation.conversationId, conversationSignature: conversation.conversationSignature, participant: { id: conversation.clientId }, + spokenTextMode: 'None', + tone: conversation.conversationStyle, }, ], invocationId: conversation.invocationId.toString(), diff --git a/src/pages/api/create.ts b/src/pages/api/create.ts index 3d1b6564..a3a3ccdf 100644 --- a/src/pages/api/create.ts +++ b/src/pages/api/create.ts @@ -19,7 +19,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }) : '' debug(`try ${count+1}`, endpoint, headers['x-forwarded-for']) const response = await fetch(`https://${endpoint || 'www.bing.com'}/turing/conversation/create?${query}`, { method: 'GET', headers }) - debug('status', headers, response.status, response.url) + debug('status', response.status, response.url) if (response.status === 200) { const json = await response.json().catch(e => {}) if (!json?.conversationSignature) {