Skip to content

Comments

Fix: Remove extraneous JSON preamble from LLM responses#10966

Merged
hamza221 merged 2 commits intomainfrom
fix/smart-replies-markdown
Apr 4, 2025
Merged

Fix: Remove extraneous JSON preamble from LLM responses#10966
hamza221 merged 2 commits intomainfrom
fix/smart-replies-markdown

Conversation

@hamza221
Copy link
Contributor

@hamza221 hamza221 commented Apr 4, 2025

Added unit test for #10957
Was not able to push to @sto-j 's branch

The most of the LLM's return in JSON markdown format, example:
```json
{
  "reply1": "Received, thanks...",
  "reply2": "Thanks for forwarding this..."
}
```
Adding additional instructions did't help. 

This is solution to strip:
```json
```
from the answer. 

Signed-off-by: sto-j <162719726+sto-j@users.noreply.github.com>
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the fix/smart-replies-markdown branch from 34ff286 to 3dd8b5a Compare April 4, 2025 13:04
@hamza221 hamza221 enabled auto-merge April 4, 2025 13:04
@hamza221 hamza221 merged commit 3e9b1e4 into main Apr 4, 2025
36 checks passed
@hamza221 hamza221 deleted the fix/smart-replies-markdown branch April 4, 2025 13:14
@ChristophWurst
Copy link
Member

/backport to stable5.0

@ChristophWurst
Copy link
Member

/backport to stable4.3

@backportbot

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants