opencti icon indicating copy to clipboard operation
opencti copied to clipboard

AskAI doesn't work on content with images

Open JeremyCloarec opened this issue 1 year ago • 3 comments

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

  1. OS (where OpenCTI server runs): { e.g. Mac OS 10, Windows 10, Ubuntu 16.4, etc. }
  2. OpenCTI version: { e.g. OpenCTI 1.0.2 }
  3. OpenCTI client: { e.g. frontend or python }
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Go to a report
  2. Go to content main content
  3. Insert a screenshot in the content
  4. Click on AskAI and click on Fix spelling & grammar

Expected Output

Output from AI

Actual Output

We get an error

Additional information

Screenshots (optional)

image

JeremyCloarec avatar Jun 14 '24 08:06 JeremyCloarec

@JeremyCloarec I have an error, but not same as you:

https://github.com/OpenCTI-Platform/opencti/assets/148041607/f78596f3-b661-4f7c-b8c9-ce4ef64f334a

nino-filigran avatar Jun 17 '24 07:06 nino-filigran

(And I had to do it 2 or 3 times to get the error, since at first I did not have any issue)

nino-filigran avatar Jun 17 '24 07:06 nino-filigran

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

JeremyCloarec avatar Jun 17 '24 07:06 JeremyCloarec

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.

SarahBocognano avatar Apr 14 '25 10:04 SarahBocognano

I'm not reproducing the same error either. I'm closing the issue as non reproducable

JeremyCloarec avatar Jun 05 '25 08:06 JeremyCloarec