forked from microsoft/prompt-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into abhishek/descriptionOperatorCodeEngine
- Loading branch information
Showing
14 changed files
with
323 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type: chat-engine | ||
config: | ||
model-config: | ||
max-tokens: 1024 | ||
user-name: "Abhishek" | ||
bot-name: "Bot" | ||
description: "What is the possibility of an event happening?" | ||
examples: | ||
- input: "Roam around Mars" | ||
response: "This will be possible in a couple years" | ||
- input: "Drive a car" | ||
response: "This is possible after you get a learner drivers license" | ||
flow-reset-text: "Starting a new conversation" | ||
dialog: | ||
- input: "Drink water" | ||
response: "Uhm...You don't do that 8 times a day?" | ||
- input: "Walk on air" | ||
response: "For that you'll need a special device" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type: code-engine | ||
config: | ||
model-config: | ||
max-tokens: 1024 | ||
description: "Natural Language Commands to Math Code" | ||
examples: | ||
- input: "what's 10 plus 18" | ||
response: "console.log(10 + 18)" | ||
- input: "what's 10 times 18" | ||
response: "console.log(10 * 18)" | ||
dialog: | ||
- input: "what's 18 divided by 10" | ||
response: "console.log(10 / 18)" | ||
- input: "what's 18 factorial 10" | ||
response: "console.log(10 % 18)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
type: prompt-engine | ||
config: | ||
model-config: | ||
max-tokens: 1024 | ||
description-prefix: ">>" | ||
description-postfix: "" | ||
newline-operator: "\n" | ||
input-prefix: "Human:" | ||
input-postfix: "" | ||
output-prefix: "Bot:" | ||
output-postfix: "" | ||
description: "What is the possibility of an event happening?" | ||
examples: | ||
- input: "Roam around Mars" | ||
response: "This will be possible in a couple years" | ||
- input: "Drive a car" | ||
response: "This is possible after you get a learner drivers license" | ||
flow-reset-text: "Starting a new conversation" | ||
dialog: | ||
- input: "Drink water" | ||
response: "Uhm...You don't do that 8 times a day?" | ||
- input: "Walk on air" | ||
response: "For that you'll need a special device" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const { ChatEngine } = require("./../../out/ChatEngine"); | ||
const { readFileSync } = require("fs"); | ||
|
||
const promptEngine = new ChatEngine(); | ||
|
||
const yamlConfig = readFileSync("./examples/yaml-examples/chat.yaml", "utf8"); | ||
promptEngine.loadYAML(yamlConfig); | ||
|
||
console.log(promptEngine.buildContext("", true)) | ||
|
||
/* Output for this example is: | ||
PROMPT | ||
What is the possibility of an event happening? | ||
Abhishek: Roam around Mars | ||
Bot: This will be possible in a couple years | ||
Abhishek: Drive a car | ||
Bot: This is possible after you get a learner drivers license | ||
Starting a new conversation | ||
Abhishek: Drink water | ||
Bot: Uhm...You don't do that 8 times a day? | ||
Abhishek: Walk on air | ||
Bot: For that you'll need a special device | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const { CodeEngine } = require("./../../out/CodeEngine"); | ||
const { readFileSync } = require("fs"); | ||
|
||
const promptEngine = new CodeEngine(); | ||
|
||
const yamlConfig = readFileSync("./examples/yaml-examples/code.yaml", "utf8"); | ||
promptEngine.loadYAML(yamlConfig); | ||
|
||
const prompt = promptEngine.buildPrompt("what's 18 to the power of 10"); | ||
|
||
console.log(prompt) | ||
|
||
// Output for this example is: | ||
// | ||
// /* Natural Language Commands to Math Code */ | ||
// | ||
// /* what's 10 plus 18 */ | ||
// console.log(10 + 18) | ||
// | ||
// /* what's 10 times 18 */ | ||
// console.log(10 * 18) | ||
// | ||
// /* what's 18 divided by 10 */ | ||
// console.log(10 / 18) | ||
// | ||
// /* what's 18 factorial 10 */ | ||
// console.log(10 % 18) | ||
// | ||
// /* what's 18 to the power of 10 */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { PromptEngine } = require("./../../out/PromptEngine"); | ||
const { readFileSync } = require("fs"); | ||
|
||
const promptEngine = new PromptEngine(); | ||
|
||
const yamlConfig = readFileSync("./examples/yaml-examples/general.yaml", "utf8"); | ||
promptEngine.loadYAML(yamlConfig); | ||
|
||
console.log(promptEngine.buildContext("", true)) | ||
|
||
/* | ||
Output of this example is: | ||
>> What is the possibility of an event happening? ! | ||
Human: Roam around Mars | ||
Bot: This will be possible in a couple years | ||
Human: Drive a car | ||
Bot: This is possible after you get a learner drivers license | ||
>> Starting a new conversation ! | ||
Human: Drink water | ||
Bot: Uhm...You don't do that 8 times a day? | ||
Human: Walk on air | ||
Bot: For that you'll need a special device | ||
*/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.