Skip to content

Commit e20bc0a

Browse files
Merge pull request #253 from prompt-foundry/readme-update-0809
updat example
2 parents 1370ebc + 93b6773 commit e20bc0a

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ async function main() {
3939
const completionCreateResponse = await client.completion.create('637ae1aa8f4aa6fad144ccbd', {
4040
// Optionally append additional messages to the converstation thread on top of your configured prompt messages
4141
appendMessages: [
42-
{ role: 'user', content: [{ type: 'TEXT', text: 'What is the weather in Seattle, WA?' }] },
42+
{
43+
role: 'user',
44+
content: [
45+
{
46+
type: 'TEXT',
47+
text: 'What is the weather in Seattle, WA?',
48+
},
49+
],
50+
},
4351
],
4452
// Supports prompt template variables
4553
variables: {},
@@ -84,6 +92,17 @@ async function main() {
8492
// Retrieve model parameters for the prompt
8593
const modelParameters = await promptFoundry.prompts.getParameters('1212121', {
8694
variables: { hello: 'world' },
95+
appendMessages: [
96+
{
97+
role: 'user',
98+
content: [
99+
{
100+
type: 'TEXT',
101+
text: 'What is the weather in Seattle, WA?',
102+
},
103+
],
104+
},
105+
],
87106
});
88107

89108
// check if provider is Open AI
@@ -127,6 +146,17 @@ async function main() {
127146
// Retrieve model parameters for the prompt
128147
const modelParameters = await promptFoundry.prompts.getParameters('1212121', {
129148
variables: { hello: 'world' },
149+
appendMessages: [
150+
{
151+
role: 'user',
152+
content: [
153+
{
154+
type: 'TEXT',
155+
text: 'What is the weather in Seattle, WA?',
156+
},
157+
],
158+
},
159+
],
130160
});
131161

132162
// check if provider is Open AI

0 commit comments

Comments
 (0)