Skip to content

Commit

Permalink
Fix issues with escaped strings
Browse files Browse the repository at this point in the history
  • Loading branch information
workeffortwaste authored May 2, 2023
1 parent f2571d0 commit 06896ab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/gpt__prompt__content_extraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ const content = (new pkg.Readability(documentClone).parse()).textContent

/* Ask gpt-3.5-turbo to summarize the content */
return {
prompt: \`Summarize the following content: \${ content }\`
prompt: `Summarize the following content: ${ content }`
}
7 changes: 5 additions & 2 deletions examples/gpt__prompt__raw_html.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/* horseman-config enable-openai */

/**
* This is a simple example of using the raw HTML content with a prompt.
* This is a simple example of using the raw HTML content with a prompt.
* Note this will likely cause an error if you're sending the complete HTML.
* Horseman will attempt to limit the amount of tokens you're sending by truncating
* your probme but it's not perfect.
*/

/* Fetch the raw HTML */
const html = document.documentElement.outerHTML

/* Ask gpt-3.5-turbo to generate a new description */
return {
prompt: \`Do something with the following HTML: \${ html } \`
prompt: `Do something with the following HTML: ${ html } `
}
2 changes: 1 addition & 1 deletion examples/gpt__prompt__raw_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ const html = document.body.innerText

/* Ask gpt-3.5-turbo to generate a new description */
return {
prompt: \`Do something with the following text: \${ html } \`
prompt: `Do something with the following text: ${ html }`
}
2 changes: 1 addition & 1 deletion examples/gpt__prompt__single_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ if (!meta) return

/* Ask gpt-3.5-turbo to generate a new description */
return {
prompt: \`Rewrite the following as a short 160 character poem: \${ meta } \`
prompt: `Rewrite the following as a short 160 character poem: ${ meta }`
}

0 comments on commit 06896ab

Please sign in to comment.