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

feat(config, engine): add support for Mistral AI provider and engine #436

Merged

Conversation

pedro-valentim
Copy link
Contributor

feat(engine): add support for Mistral AI engine
feat(config): add Mistral AI provider to model list and validators
refactor(engine): update engine interface to include MistralClient

@di-sukharev di-sukharev changed the base branch from master to dev November 29, 2024 20:29
Copy link
Owner

@di-sukharev di-sukharev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job, thank you for contribution

Copy link
Owner

@di-sukharev di-sukharev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you forgot to add the dependency to package.json

@pedro-valentim pedro-valentim force-pushed the feat/add-mistral-ai-as-provider branch from fcec194 to a4c0ed2 Compare December 2, 2024 13:01
@pedro-valentim
Copy link
Contributor Author

i think you forgot to add the dependency to package.json

@di-sukharev thanks! done

@di-sukharev
Copy link
Owner

@pedro-valentim something is off with the unit-test, check pls

@pedro-valentim pedro-valentim force-pushed the feat/add-mistral-ai-as-provider branch from 1ada6ff to f4032af Compare December 4, 2024 19:04
@pedro-valentim
Copy link
Contributor Author

@pedro-valentim something is off with the unit-test, check pls

I recreated npm lock file with correct node version, we can try again...

thx

@di-sukharev
Copy link
Owner

@pedro-valentim something is off with this line:

4s
Run npm run test:unit

> [email protected] test:unit
> NODE_OPTIONS=--experimental-vm-modules jest test/unit

jest-haste-map: Haste module naming collision: commitlint-test
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/e2e/prompt-module/data/commitlint_[1](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:1)8/package.json
    * <rootDir>/test/e2e/prompt-module/data/commitlint_19/package.json

FAIL test/unit/gemini.test.ts
  ● Test suite failed to run

    ReferenceError: exports is not defined

      1 | import 'cli-testing-library/extend-expect'
    > 2 | import { configure } from 'cli-testing-library'
        |                       ^
      3 | import { jest } from '@jest/globals';
      [4](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:5) |
      [5](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:6) | global.jest = jest;

      at test/jest-setup.ts:2:23

(node:1788) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
FAIL test/unit/config.test.ts
  ● Test suite failed to run

    ReferenceError: exports is not defined

      1 | import 'cli-testing-library/extend-expect'
    > 2 | import { configure } from 'cli-testing-library'
        |                       ^
      3 | import { jest } from '@jest/globals';
      4 |
      5 | global.jest = jest;

      at test/jest-setup.ts:2:23

(node:1[7](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:8)[8](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:9)7) ExperimentalWarning: VM Modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        2.42[9](https://github.com/di-sukharev/opencommit/actions/runs/12166548762/job/33966594143?pr=436#step:5:10) s
Ran all test suites matching /test\/unit/i.
Error: Process completed with exit code 1.

mb they have a breaking change and we need to revert the library back or just fix the export path or function name?

@pedro-valentim
Copy link
Contributor Author

pedro-valentim commented Dec 5, 2024

hmmm, i was able to reproduce the error locally when using node v20.18.1 (v20 latest) and it seems to be resolved now

we can try again

@di-sukharev di-sukharev merged commit 2068876 into di-sukharev:dev Dec 11, 2024
3 checks passed
} catch (error) {
const err = error as Error;
if (
axios.isAxiosError<{ error?: { message: string } }>(error) &&
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wont be hit

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to remove the try/catch from the engines and prob do one try/catch in the Engine

di-sukharev added a commit that referenced this pull request Dec 14, 2024
* 378: fix hook env (#402)

* fix(prepare-commit-msg-hook): update error handling to provide clearer instructions for setting API keys and improve user guidance

* Fix: a bug that causes an error when pushing without setting git remote (#396)

* update deploy commands

* feat(cli): add context flag for providing additional commit message input

* Fix [Bug]: punycode` module is deprecated #426 (#433)

Signed-off-by: Tiger Kaovilai <[email protected]>

* npm audit fix (#432)

Signed-off-by: Tiger Kaovilai <[email protected]>

* Feat: Add an option to `Don't push` when there are multiple git remotes (#434)

---------

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

* feat(engine): add support for MLX AI provider (#437)

---------

Signed-off-by: Emmanuel Ferdman <[email protected]>
Co-authored-by: Emmanuel Ferdman <[email protected]>

* feat(config, engine): add support for Mistral AI provider and engine (#436)

* docs(CONTRIBUTING.md): update `TODO.md` reference (#435)

Signed-off-by: Emmanuel Ferdman <[email protected]>

* feat(config, engine): add support for Mistral AI provider and engine

* ```
feat(package): add mistralai and zod dependencies
```

* fix: recreate package-lock.json with node20

* fix: recreate package-lock.json with node v20.18.1 based on branch dev

---------

Signed-off-by: Emmanuel Ferdman <[email protected]>
Co-authored-by: Emmanuel Ferdman <[email protected]>
Co-authored-by: pedro-valentim <>

---------

Signed-off-by: Tiger Kaovilai <[email protected]>
Signed-off-by: Emmanuel Ferdman <[email protected]>
Co-authored-by: Takanori Matsumoto <[email protected]>
Co-authored-by: BILLY Maxime <[email protected]>
Co-authored-by: Welington Sampaio <[email protected]>
Co-authored-by: Tiger Kaovilai <[email protected]>
Co-authored-by: albi ⚡️ <[email protected]>
Co-authored-by: Emmanuel Ferdman <[email protected]>
Co-authored-by: Pedro Valentim Silva Leite <[email protected]>
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.

3 participants