Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
Size Change: +1.08 kB (+0.03%) Total Size: 4.22 MB
|
|
🚀 Preview will be available at https://docs-ia.beta.numerique.gouv.fr/ You must create a access with yopmail. Once this Pull Request is merged, the preview will be destroyed. |
7d5fed3 to
85ae764
Compare
a899b5d to
b617394
Compare
Closed
352dbd0 to
d53583f
Compare
d53583f to
f161c8f
Compare
34090ea to
d44f9e9
Compare
d1eb55d to
c33b56c
Compare
lunika
approved these changes
Feb 24, 2026
c33b56c to
2d70ce6
Compare
Add AI proxy to handle AI related requests to the AI service.
We make the AI bot configurable with settings. We will be able to have different AI bot name per instance.
We want to handle both streaming or not when interacting with the AI backend service.
Standard can vary depending on the AI service used. To work with Albert API: - a description field is required in the payload for every tools call. - if stream is set to false, stream_options must be omitted from the payload. - the response from Albert sometimes didn't respect the format expected by Blocknote, so we added a system prompt to enforce it.
We integrate the new Blocknote AI feature into Docs, enhancing the document editing experience with AI capabilities.
AI feature is under AGPL license, so it is removed when the project is under MIT license. NEXT_PUBLIC_PUBLISH_AS_MIT manage this.
Bind ai_proxy abilities to the AI feature. If ai_proxy is false, the AI feature will not be available.
notify screen readers about ai thinking, writing, ready, or error
This is a naive first switch from sync to async. This enables the backend to still answer to incomming requests while streaming LLM results to the user. For sure there is room for code cleaning and improvements, but this provides a nice improvement out of the box.
The frontend application is using Vercel AI SDK and it's data stream protocol. We decided to use the pydantic AI library to use it's vercel ai adapter. It will make the payload validation, use AsyncIterator and deal with vercel specification.
When the tool applyDocumentOperations is used, we have to force the usage of a system prompt in order to force the model to use it the right without inventing different actions. The pydantic Agent class can use a system prompt but this noe is ignoried when a UI adapter is used like the VercelAiAdapter.
We don't need anymore the AI_STREAM settings, we use the stream all the time.
2d70ce6 to
24ec1fa
Compare
This was referenced Feb 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
New AI feature powered by Blocknote. 🚀
Proposal
New Settings:
AI_STREAMis a setting because not all model support the stream mode.Careful
You can still use the previous AI feature that is under MIT license.
Demo
Enregistrement.2026-02-03.113122.mp4