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

⚗️AI return with complex data #403

Open
AntoLC opened this issue Nov 6, 2024 · 0 comments
Open

⚗️AI return with complex data #403

AntoLC opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
backend bug Something isn't working editor enhancement New feature or request frontend

Comments

@AntoLC
Copy link
Collaborator

AntoLC commented Nov 6, 2024

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

@AntoLC AntoLC added bug Something isn't working enhancement New feature or request frontend backend editor labels Nov 6, 2024
@AntoLC AntoLC self-assigned this Dec 4, 2024
@AntoLC AntoLC linked a pull request Dec 4, 2024 that will close this issue
@AntoLC AntoLC linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working editor enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant