agnai icon indicating copy to clipboard operation
agnai copied to clipboard

Emphasis within Quotes

Open Aldimensch opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe. I noticed that larger models really like to add Emphasis inside Spoken Text, causing the current Rendering to default to normal Emphasis Style. eg. <em> tags. Image

Describe the solution you'd like Add a new class of CSS that is added within a <q> tag. Image

Furthermore, a new UI Setting should be included to change the color of the Emphasis in Quotes, aswell as a toggle which allows BOLD or and Italic to be selected. Image

Task: Update the UI Preview to reflect the new Feature.

Describe alternatives you've considered I am not getting paid enough to think about Alternatives. ;-)

The quote magic happens here: I belive https://github.com/agnaistic/agnai/blob/1fe29e0f2526217fe844e3c15bf00b5b03d6193f/web/pages/Chat/components/Message.tsx#L777

And the CSS magic is here: https://github.com/agnaistic/agnai/blob/1fe29e0f2526217fe844e3c15bf00b5b03d6193f/web/pages/Chat/components/Message.css#L6

Aldimensch avatar Jun 18 '25 12:06 Aldimensch

While working on that, maybe also match common and pretty quotation marks. Or at least create an option to match them. I don't know why, but some models really have issues with matching them sometimes. I usually exclude them in DRY but in this case I was using regular Repetition penalty without DRY. Image

Put on your regEx magic hat. https://github.com/agnaistic/agnai/blob/1fe29e0f2526217fe844e3c15bf00b5b03d6193f/web/pages/Chat/components/Message.tsx#L781-L782

It might be easier just to replace all Double Quotes with the common one. We can't control what the Model will output as a Quote Mark, but we can replace it regardless to Straight Double Quotes. Which makes it easier for us to match the Quotation marks.

A list from our friend Gemini of what types of Quotes exist. And as a german, I already know why we are hated. xD Dig deeper to catch them all. plays pokemon intro in head

Straight Double Quote:
Character: "
HTML Entity: &quot; or &#34;

Left Double Quote:
Character: “
HTML Entity: &ldquo; or &#8220;

Right Double Quote:
Character: ”
HTML Entity: &rdquo; or &#8221;

Bottom Double Quote (German opening/low 99):
Character: „
HTML Entity: &bdquo; or &#8222;

Aldimensch avatar Jun 18 '25 13:06 Aldimensch