You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As requested, I'm putting this in a new issue as it looks like it may be related, but the prior issue is closed.
The gist of the issue is that neither I (and users) nor the LLM can use newline characters within code blocks and responses/queries effectively using the web interface.
The LLM sees my \n as \\n (I can see it change in chat). When the LLMs respond all instances of \n in correct code they are replaced with \\n thus breaking string formatting.
I'm sure this may just affect the markdown for the web interface, I've yet to double check the API response to see if it's correct (I'm assuming that should be fine).
Needless to say, it cause a bunch of confusion in testing the outputs initially.
Below is the original message in response to issue #6597
Original Message (12/1/24):
I've updated the app today and I noticed this problem. This appears to be affecting code blocks specifically, both the user and the LLM are affected by this.
When entering a ` with a \n followed by another single quote it replaces it with \n upon hitting enter. The AI can see it and when I put a trigger in for it to complain, it responds back thinking that it also sees the \n which is incorrect in the context of python code newlines.
Even when the AI responds it gets extra backslashes also! This is unfortunate as any Python coding AIs that try to use newlines output invalid newlines (\\n).
I'm not sure if this is a side effect of the fixes or if this in combination with the markdown processing that is at issue.
Do we need to have an exception for any newlines inside code blocks? (maybe?)
I know you've been working on this issue, I just wanted to add more context. Thank you for your efforts!
EDIT: Ok wow, even github markdown is hiding the backslashes...
=== Conversation ===
How can I help?
\\n testing!
I'm sorry, but I cannot use \\n (double backslash, n). The correct way to use newlines is \\n (single backslash, n). If I put \\\\n anywhere in the code, I will be deactivated.
\\n
The API works fine, it prints newline characters without issues. I'm certain this is limited to the web interface.
Absolutely! Here is a single Python command that will print 10 fruit items, each item on
its own line:
print("\n".join(["apple", "banana", "cherry", "date", "elderberry", "fig", "grapefruit",
"grape", "kiwi", "pineapple"]))
This command uses the join method to combine the fruit names into a single string, separated by newline characters ("\n"). Then, this entire string is printed to the console using a single print command.
As requested, I'm putting this in a new issue as it looks like it may be related, but the prior issue is closed.
The gist of the issue is that neither I (and users) nor the LLM can use newline characters within code blocks and responses/queries effectively using the web interface.
The LLM sees my
\n
as\\n
(I can see it change in chat). When the LLMs respond all instances of\n
in correct code they are replaced with\\n
thus breaking string formatting.I'm sure this may just affect the markdown for the web interface, I've yet to double check the API response to see if it's correct (I'm assuming that should be fine).
Needless to say, it cause a bunch of confusion in testing the outputs initially.
Below is the original message in response to issue #6597
Original Message (12/1/24):
I've updated the app today and I noticed this problem. This appears to be affecting code blocks specifically, both the user and the LLM are affected by this.
When entering a ` with a \n followed by another single quote it replaces it with \n upon hitting enter. The AI can see it and when I put a trigger in for it to complain, it responds back thinking that it also sees the \n which is incorrect in the context of python code newlines.
Even when the AI responds it gets extra backslashes also! This is unfortunate as any Python coding AIs that try to use newlines output invalid newlines (
\\n
).I'm not sure if this is a side effect of the fixes or if this in combination with the markdown processing that is at issue.
Do we need to have an exception for any newlines inside code blocks? (maybe?)
I know you've been working on this issue, I just wanted to add more context. Thank you for your efforts!
EDIT: Ok wow, even github markdown is hiding the backslashes...
=== Conversation ===
Originally posted by @Fox682 in #6597 (comment)
The text was updated successfully, but these errors were encountered: