mistralai / client-js

JS Client library for Mistral AI platform
Apache License 2.0
182 stars 46 forks source link

Having issues with overriding MistralCilent from @mistralai/mistralai methods using typescript #85

Open I560263 opened 3 months ago

I560263 commented 3 months ago

I am currently facing this error Error [ERR_REQUIRE_ESM]: require() of ES Module to a dynamic import() which is available in all CommonJS modules when I try to import MistralClient from '@mistralai/mistralai';

Muhammad-Owais-Warsi commented 3 months ago

If you are using import(), you should check your package.json to see if it has "type": "module"

ilies-t commented 2 months ago

I have the same issue, due to our TypeScript environment, we cannot set "type": "module". Unfortunately, the only solution was to implement Mistral AI API calls using Axios