Skip to content

⚗️AI return with complex data #403

@AntoLC

Description

@AntoLC

Improvement

Problem:

When we request the AI, we transform the editor data in markdown, when the data have a simple structure it works fine, but when we start to have complex structure like "Table" by example, the data back from the AI will start to be very "lossy".

Tests:

  • Try to see if we can send the json structure instead and see if the AI is smart enough to do the actions without impacting negatively the json structure.
  • Other solutions, probably better, send only the content text of the blocknote json to the AI, bind each content text with an ID (it is maybe already bind with an ID), then replace the content text of the json thanks to this ID. By doing so, we keep the complex structure on the frontside and replace only the text.

Code to improve

https://github.com/numerique-gouv/impress/blob/50891afd055b5dada1d34e57ab447638865410af/src/frontend/apps/impress/src/features/docs/doc-editor/components/AIButton.tsx#L284-L305

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions