Skip to content
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

Update build script, dependencies, and default model #8

Merged
merged 7 commits into from
Jun 30, 2024

Conversation

SHSharkar
Copy link
Member

This pull request includes several updates to improve the project.

  • The build script has been updated to use the rm -rf command instead of the rimraf package for better compatibility with Unix-based systems.

  • Dependencies have been updated to their latest versions, including @commitlint/types, @types/ini, @types/node, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, dotenv, esbuild, eslint, eslint-plugin-simple-import-sort, prettier, tsx, typescript, @dqbd/tiktoken, @octokit/webhooks-schemas, @octokit/webhooks-types, axios, execa, ini, inquirer, and openai.

  • The default model used by the application has been changed to gpt-4o for improved performance and capabilities.

  • The configuration files and README have been updated to reflect the changes.

…e dependencies

### Changes:
- **Build Script**:
  - Replaced `rimraf out` with `rm -rf out` in the `build` script for better compatibility with Unix-based systems.
  - **File**: `package.json`
  - **Line**: 64

- **DevDependencies**:
  - Updated `@commitlint/types` from `^18.6.1` to `^19.0.3`
  - Updated `@types/ini` from `^4.1.0` to `^4.1.1`
  - Updated `@types/node` from `^20.11.19` to `^20.14.9`
  - Updated `@typescript-eslint/eslint-plugin` from `^7.0.1` to `^7.14.1`
  - Updated `@typescript-eslint/parser` from `^7.0.1` to `^7.14.1`
  - Updated `dotenv` from `^16.4.4` to `^16.4.5`
  - Updated `esbuild` from `^0.20.1` to `^0.21.5`
  - Updated `eslint` from `^8.56.0` to `^9.6.0`
  - Updated `eslint-plugin-simple-import-sort` from `^12.0.0` to `^12.1.0`
  - Updated `prettier` from `^3.2.5` to `^3.3.2`
  - Updated `tsx` from `^4.7.1` to `^4.16.0`
  - Updated `typescript` from `^5.3.3` to `^5.5.2`
  - **File**: `package.json`
  - **Lines**: 74-88

- **Dependencies**:
  - Updated `@dqbd/tiktoken` from `^1.0.13` to `^1.0.15`
  - Updated `@octokit/webhooks-schemas` from `^7.3.2` to `^7.5.1`
  - Updated `@octokit/webhooks-types` from `^7.3.2` to `^7.5.1`
  - Updated `axios` from `^1.6.7` to `^1.7.2`
  - Updated `execa` from `^8.0.1` to `^9.3.0`
  - Updated `ini` from `^4.1.1` to `^4.1.3`
  - Updated `inquirer` from `^9.2.14` to `^9.3.1`
  - Updated `openai` from `^4.28.0` to `^4.52.2`
  - **File**: `package.json`
  - **Lines**: 92-108

### Explanation:
- The build script change ensures compatibility with Unix-based systems by using the native `rm -rf` command instead of the `rimraf` package.
- Dependency updates ensure the project uses the latest versions, which may include performance improvements, new features, and security patches.
- **File**: `src/api.ts`
- **Line 15**: Updated the default value of the `MODEL` constant from `'gpt-3.5-turbo-1106'` to `'gpt-4o'`.

This change updates the default model used by the application to `gpt-4o`, reflecting the latest available model for improved performance and capabilities.
- **WHAT**:
  - Added new GPT models (`gpt-4o`, `gpt-4-turbo`, `gpt-3.5-turbo-0125`) to the list of supported models.
  - Changed the default model from `gpt-3.5-turbo-1106` to `gpt-4o`.

- **WHY**:
  - To support the latest GPT models and ensure the application can utilize the most recent advancements in AI technology.
  - Changing the default model to `gpt-4o` aligns with the latest model offerings and provides better performance.

- **HOW**:
  - Updated the `validateConfig` function to include the new models in the validation list.
  - Modified the default value of `GW_MODEL` in the `getConfig` function to `gpt-4o`.

### Detailed Changes:

- **File**: `src/commands/config.ts`
  - **Line 100**: Added `gpt-4o` and `gpt-4-turbo` to the list of supported models.
  - **Line 101**: Reordered the models for better readability.
  - **Line 108**: Updated the validation error message to include the new models.
  - **Line 146**: Changed the default model from `gpt-3.5-turbo-1106` to `gpt-4o`.

### Code Snippet:

```typescript
validateConfig(
    CONFIG_KEYS.GW_MODEL,
    [
        'gpt-4o',
        'gpt-4-turbo',
        'gpt-4-turbo-preview',
        'gpt-4-0125-preview',
        'gpt-4-1106-preview',
        'gpt-4',
        'gpt-3.5-turbo-0125',
        'gpt-3.5-turbo',
        'gpt-3.5-turbo-1106',
    ].includes(value),
    `${value} is not supported yet, use 'gpt-4o','gpt-4-turbo','gpt-4-turbo-preview','gpt-4-0125-preview','gpt-4-1106-preview','gpt-4','gpt-3.5-turbo-0125','gpt-3.5-turbo','gpt-3.5-turbo-1106'`,
);

GW_MODEL: process.env.GW_MODEL || 'gpt-4o',
```

These changes ensure that the application remains up-to-date with the latest GPT models and provides a more robust and flexible configuration.
### Changes:
- **Line 70**: Updated `GW_MODEL` options to include new models and remove outdated ones.
- **Line 160**: Changed the default model from `gpt-3.5-turbo-1106` to `gpt-4o`.
- **Line 408**: Updated the default model in the GitHub Actions example to `gpt-4o`.
- **Line 425**: Revised the default model description to `gpt-4o`.

### Detailed Description:
- **Model Options Update**: The `GW_MODEL` environment variable now includes the latest models such as `gpt-4o`, `gpt-4-turbo`, and others, while removing outdated versions.
- **Default Model Change**: The default model for GitWiz has been updated to `gpt-4o` to leverage its enhanced capabilities.
- **Documentation Consistency**: Ensured that all references to the default model in the README are consistent with the new default (`gpt-4o`).

### Formatting Adjustments:
- **Indentation**: Corrected indentation for better readability in sections explaining `@commitlint` integration and other features.
- **Consistency**: Ensured consistent formatting for command examples and descriptions.
Signed-off-by: Md. Sazzad Hossain Sharkar <md@szd.sh>
…int:fix` script

- **WHAT**:
  - Added `@eslint/compat` to `devDependencies`.
  - Modified the `lint:fix` script to remove the `--ext ts` flag.

- **WHY**:
  - The addition of `@eslint/compat` ensures compatibility with ESLint configurations.
  - The `--ext ts` flag was redundant as `eslint src --fix` already covers TypeScript files.

- **HOW**:
  - Added `"@eslint/compat": "^1.1.0"` to the `devDependencies` section.
  - Updated the `lint:fix` script to `"eslint src --fix && prettier --write src"`.

```json
"devDependencies": {
    "@commitlint/types": "^19.0.3",
    "@eslint/compat": "^1.1.0",
    "@types/ini": "^4.1.1",
    "@types/inquirer": "^9.0.7",
    "@types/node": "^20.14.9"
}
```

```json
"scripts": {
    "lint:fix": "eslint src --fix && prettier --write src"
}
```
@SHSharkar SHSharkar merged commit 500ffb1 into main Jun 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant