Add prompt ids (#177)

* Add prompt ids

* Add prompt ids
This commit is contained in:
arcticfly
2023-08-18 16:56:17 -07:00
committed by GitHub
parent c6c7e746ee
commit ef1f9458f4
5 changed files with 41 additions and 2 deletions

View File

@@ -16,7 +16,16 @@ export async function getCompletion(
try {
if (onStream) {
const resp = await openai.chat.completions.create(
{ ...input, stream: true },
{
...input,
stream: true,
openpipe: {
tags: {
prompt_id: "getCompletion",
stream: "true",
},
},
},
{
maxRetries: 0,
},
@@ -34,7 +43,16 @@ export async function getCompletion(
}
} else {
const resp = await openai.chat.completions.create(
{ ...input, stream: false },
{
...input,
stream: false,
openpipe: {
tags: {
prompt_id: "getCompletion",
stream: "false",
},
},
},
{
maxRetries: 0,
},

View File

@@ -89,6 +89,11 @@ export const autogenerateDatasetEntries = async (
function_call: { name: "add_list_of_data" },
temperature: 0.5,
openpipe: {
tags: {
prompt_id: "autogenerateDatasetEntries",
},
},
});
const completionCallbacks = batchSizes.map((batchSize) =>

View File

@@ -98,6 +98,11 @@ export const autogenerateScenarioValues = async (
function_call: { name: "add_scenario" },
temperature: 0.5,
openpipe: {
tags: {
prompt_id: "autogenerateScenarioValues",
},
},
});
const parsed = JSON.parse(

View File

@@ -109,6 +109,12 @@ const requestUpdatedPromptFunction = async (
function_call: {
name: "update_prompt_constructor_function",
},
openpipe: {
tags: {
prompt_id: "deriveNewConstructFn",
model_translation: (!!newModel).toString(),
},
},
});
const argString = completion.choices[0]?.message?.function_call?.arguments || "{}";

View File

@@ -53,6 +53,11 @@ export const runGpt4Eval = async (
},
},
],
openpipe: {
tags: {
prompt_id: "runOneEval",
},
},
});
try {