diff --git a/examples/clone.ts b/examples/clone.ts index 07b733d..72317fe 100644 --- a/examples/clone.ts +++ b/examples/clone.ts @@ -18,6 +18,6 @@ const tpl = new PromptTemplate(templates.alpaca) console.log(tpl.render()); // clone -console.log("Cloning the template to Orca format:\n\n"); -const ntpl = tpl.cloneTo("orca"); +console.log("Cloning the template to Chatml format:\n\n"); +const ntpl = tpl.cloneTo("chatml"); console.log(ntpl.render()) \ No newline at end of file diff --git a/examples/one_shot.js b/examples/one_shot.js index b68d7f4..14a8de8 100644 --- a/examples/one_shot.js +++ b/examples/one_shot.js @@ -1,10 +1,10 @@ #!/usr/bin/env node -import { templates, ModelTemplate } from "modprompt"; +import { templates, PromptTemplate } from "modprompt"; -console.log("Available templates:", Object.keys(templates)); +//console.log("Available templates:", Object.keys(templates)); // load template -const tpl = new ModelTemplate(templates.alpaca) +const tpl = new PromptTemplate(templates.alpaca) .afterSystem("You are a javascript specialist") .afterAssistant(" (answer in valid json)") .replacePrompt("fix this invalid json:\n\n```json\n{prompt}\n```") diff --git a/examples/simple.js b/examples/simple.js deleted file mode 100644 index 705623e..0000000 --- a/examples/simple.js +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env node - -import { templates, ModelTemplate } from "modprompt"; - -console.log("Available templates:", Object.keys(templates)); -// load template -const tpl = new ModelTemplate(templates.llama) -// render the template -console.log(tpl.render()) \ No newline at end of file diff --git a/examples/simple.ts b/examples/simple.ts new file mode 100644 index 0000000..011d5dd --- /dev/null +++ b/examples/simple.ts @@ -0,0 +1,11 @@ +#!/usr/bin/env node + +import { templates, PromptTemplate } from "../src/main.js"; + +console.log("Available templates:", Object.keys(templates)); +// load template +//const tpl = new PromptTemplate(templates.alpaca) +const tpl = new PromptTemplate(templates.mistral); +tpl.addShot("2+2", "4"); +// render the template +console.log(`'${tpl.render()}'`) \ No newline at end of file