AskAI doesn't work on content with images
Description
It looks like askAI doesn't work properly when an image is inserted in the content. We get the following error: An error occurred: MistralAPIError: HTTP error! status: 400 Response: {"object":"error","message":"max_tokens must be at least 1, got -5973.","type":"BadRequestError","param":null,"code":400}
Environment
- OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
- OpenCTI version: { e.g. OpenCTI 1.0.2 }
- OpenCTI client: { e.g. frontend or python }
- Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Go to a report
- Go to content main content
- Insert a screenshot in the content
- Click on AskAI and click on Fix spelling & grammar
Expected Output
Output from AI
Actual Output
We get an error
Additional information
Screenshots (optional)
@JeremyCloarec I have an error, but not same as you:
https://github.com/OpenCTI-Platform/opencti/assets/148041607/f78596f3-b661-4f7c-b8c9-ce4ef64f334a
(And I had to do it 2 or 3 times to get the error, since at first I did not have any issue)
Ok, maybe it's two different bugs then. The bug I described in the issue can be reproduced on report with id 353c940b-bf95-43ee-ab4f-20b738f0a3d8 on testing
The issue doesn't seems to appears anymore. I sometimes have a time out error as Nino pointed it, but most of the time it's working pretty well. Even with the id 353c940b-bf95-43ee-ab4f-20b738f0a3d8 on testing.
I'm not reproducing the same error either. I'm closing the issue as non reproducable