Skip to content

Commit

Permalink
Merge branch 'ChatGPTNextWeb:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Xieyos authored Feb 7, 2024
2 parents 94bf14c + 9d5801f commit 5400c6f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ jobs:
- os: ubuntu-latest
arch: x86_64
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
arch: x86_64
rust_target: x86_64-apple-darwin
- os: macos-latest
arch: aarch64
rust_target: aarch64-apple-darwin
rust_target: x86_64-apple-darwin,aarch64-apple-darwin
- os: windows-latest
arch: x86_64
rust_target: x86_64-pc-windows-msvc
Expand All @@ -60,13 +57,14 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
key: ${{ matrix.config.os }}
- name: install dependencies (ubuntu only)
if: matrix.config.os == 'ubuntu-latest'
run: |
Expand All @@ -79,8 +77,15 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }}

publish-release:
permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types:
- opened
- synchronize
- reopened

env:
VERCEL_TEAM: ${{ secrets.VERCEL_TEAM }}
Expand Down
18 changes: 11 additions & 7 deletions app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@ function countMessages(msgs: ChatMessage[]) {
}

function fillTemplateWith(input: string, modelConfig: ModelConfig) {
const cutoff = KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default;
const cutoff =
KnowledgeCutOffDate[modelConfig.model] ?? KnowledgeCutOffDate.default;
// Find the model in the DEFAULT_MODELS array that matches the modelConfig.model
const modelInfo = DEFAULT_MODELS.find(m => m.name === modelConfig.model);
if (!modelInfo) {
throw new Error(`Model ${modelConfig.model} not found in DEFAULT_MODELS array.`);
const modelInfo = DEFAULT_MODELS.find((m) => m.name === modelConfig.model);

var serviceProvider = "OpenAI";
if (modelInfo) {
// TODO: auto detect the providerName from the modelConfig.model

// Directly use the providerName from the modelInfo
serviceProvider = modelInfo.provider.providerName;
}
// Directly use the providerName from the modelInfo
const serviceProvider = modelInfo.provider.providerName;

const vars = {
ServiceProvider: serviceProvider,
Expand All @@ -119,7 +123,7 @@ function fillTemplateWith(input: string, modelConfig: ModelConfig) {
}

Object.entries(vars).forEach(([name, value]) => {
const regex = new RegExp(`{{${name}}}`, 'g');
const regex = new RegExp(`{{${name}}}`, "g");
output = output.replace(regex, value.toString()); // Ensure value is a string
});

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "NextChat",
"version": "2.10.1"
"version": "2.10.2"
},
"tauri": {
"allowlist": {
Expand Down

0 comments on commit 5400c6f

Please sign in to comment.