escape http snippets
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte
CHANGED
@@ -196,7 +196,7 @@ print(output.choices[0].message)`,
|
|
196 |
const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>
|
197 |
start +
|
198 |
getMessages()
|
199 |
-
.map(({ role, content }) => `{ "role": "${role}", "content": "${content}" }`)
|
200 |
.join(sep) +
|
201 |
end;
|
202 |
|
|
|
196 |
const formattedMessages = ({ sep, start, end }: MessagesJoiner) =>
|
197 |
start +
|
198 |
getMessages()
|
199 |
+
.map(({ role, content }) => `{ "role": "${role}", "content": "${content?.replace(/"/g, '\\"')}" }`)
|
200 |
.join(sep) +
|
201 |
end;
|
202 |
|