-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Allow $
to literally denote quantities of USD in chat
#1068
Conversation
aa1ab27
to
cab6156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the formatting for several LLMs: all Bedrock Chat Anthropic LLMs, Llama3 models, and mistral models. The formatting looks great and does not fall afoul of TeX formatting $ limiters.
Even if you prompt it to use TeX formatting it does so by displaying the formatting and not forcing math mode, as shown here:
So the modification in this PR is robuest and all LGTM.
@srdas Thanks for the review! Actually your testing pointed out a regression. While we don’t want to treat JupyterLab overrides the default delimiters set by MathJax, which is why we have to escape single dollar signs in our application despite MathJax being the default implementation of I'll update this PR to allow for double dollar signs while still escaping single dollar signs. |
I also noticed this in my testing, because at one point it returned this sort of formatting, but I was unable to reproduce it again when I tried. Good you caught it again. |
It may be easier to somehow change the MathJax config to simply not respect |
a98ceef
to
d82c04a
Compare
This strategy proved to be too complex. I tried creating a new instance of I've updated this PR and its description to address the 2 bugs called out earlier:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of AI to correct AI! Jupyter AI is now officially self-repairing!
LGTM!
5838a78
to
9aad1cb
Compare
@meeseeksdev please backport to v3-dev |
… of USD in chat
… chat (#1079) Co-authored-by: david qiu <[email protected]>
Description
$
to literally denote multiple quantities of USD per line in the chat by escaping dollar signs in the frontend.$$
, so$$
can still be used to delimit display math.$
when it is being shown literally within acode
,pre
,kbd
, orsamp
element. This list of "literal elements" was derived from: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code#see_also\( <math> \)
to denote inline math, while allowing$$ <math> $$
and\[ <math> \]
to denote display math.@jupyterlab/mathjax-extension
: https://docs.mathjax.org/en/latest/input/tex/delimiters.html$
as an inline math delimiter, but instead use LaTeX math delimiters (i.e.\( <math> \)
instead of$<math>$
).Demo