Add user's current prompt to prompt derivation
This commit is contained in:
@@ -52,11 +52,15 @@ const requestUpdatedPromptFunction = async (
|
|||||||
2,
|
2,
|
||||||
)}\n\nDo not add any assistant messages.`,
|
)}\n\nDo not add any assistant messages.`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
role: "user",
|
||||||
|
content: `This is the current prompt constructor function:\n---\n${originalVariant.constructFn}`,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
if (newModel) {
|
if (newModel) {
|
||||||
messages.push({
|
messages.push({
|
||||||
role: "user",
|
role: "user",
|
||||||
content: `Return the prompt constructor function for ${newModel} given the following prompt constructor function for ${originalModel}:\n---\n${originalVariant.constructFn}`,
|
content: `Return the prompt constructor function for ${newModel} given the existing prompt constructor function for ${originalModel}`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (instructions) {
|
if (instructions) {
|
||||||
@@ -65,10 +69,6 @@ const requestUpdatedPromptFunction = async (
|
|||||||
content: instructions,
|
content: instructions,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
messages.push({
|
|
||||||
role: "system",
|
|
||||||
content: "The prompt variable has already been declared, so do not declare it again.",
|
|
||||||
});
|
|
||||||
const completion = await openai.chat.completions.create({
|
const completion = await openai.chat.completions.create({
|
||||||
model: "gpt-4",
|
model: "gpt-4",
|
||||||
messages,
|
messages,
|
||||||
|
|||||||
Reference in New Issue
Block a user