Fix prompt duplication (#205)

* Update client libs typescript README

* Properly duplicate variant
This commit is contained in:
arcticfly
2023-08-28 16:10:56 -07:00
committed by GitHub
parent 48aa697002
commit ab87794192
2 changed files with 13 additions and 10 deletions

View File

@@ -196,7 +196,10 @@ export const promptVariantsRouter = createTRPCRouter({
? `${originalVariant?.label} Copy`
: `Prompt Variant ${largestSortIndex + 2}`;
const newConstructFn = await deriveNewConstructFn(originalVariant);
const newConstructFn = await deriveNewConstructFn(
originalVariant,
originalVariant?.promptConstructor,
);
const createNewVariantAction = prisma.promptVariant.create({
data: {

View File

@@ -28,15 +28,15 @@ export async function deriveNewConstructFn(
);
}
return dedent`
prompt = {
model: "gpt-3.5-turbo",
messages: [
{
role: "system",
content: "Return 'Hello, world!'",
}
]
}`;
definePrompt("openai/ChatCompletion", {
model: "gpt-3.5-turbo-0613",
messages: [
{
role: "system",
content: \`Hello, world!\`,
},
],
});`;
}
const NUM_RETRIES = 5;