@@ -16,7 +16,16 @@ export async function getCompletion(
|
|||||||
try {
|
try {
|
||||||
if (onStream) {
|
if (onStream) {
|
||||||
const resp = await openai.chat.completions.create(
|
const resp = await openai.chat.completions.create(
|
||||||
{ ...input, stream: true },
|
{
|
||||||
|
...input,
|
||||||
|
stream: true,
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "getCompletion",
|
||||||
|
stream: "true",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
maxRetries: 0,
|
maxRetries: 0,
|
||||||
},
|
},
|
||||||
@@ -34,7 +43,16 @@ export async function getCompletion(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const resp = await openai.chat.completions.create(
|
const resp = await openai.chat.completions.create(
|
||||||
{ ...input, stream: false },
|
{
|
||||||
|
...input,
|
||||||
|
stream: false,
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "getCompletion",
|
||||||
|
stream: "false",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
maxRetries: 0,
|
maxRetries: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ export const autogenerateDatasetEntries = async (
|
|||||||
|
|
||||||
function_call: { name: "add_list_of_data" },
|
function_call: { name: "add_list_of_data" },
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "autogenerateDatasetEntries",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const completionCallbacks = batchSizes.map((batchSize) =>
|
const completionCallbacks = batchSizes.map((batchSize) =>
|
||||||
|
|||||||
@@ -98,6 +98,11 @@ export const autogenerateScenarioValues = async (
|
|||||||
|
|
||||||
function_call: { name: "add_scenario" },
|
function_call: { name: "add_scenario" },
|
||||||
temperature: 0.5,
|
temperature: 0.5,
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "autogenerateScenarioValues",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const parsed = JSON.parse(
|
const parsed = JSON.parse(
|
||||||
|
|||||||
@@ -109,6 +109,12 @@ const requestUpdatedPromptFunction = async (
|
|||||||
function_call: {
|
function_call: {
|
||||||
name: "update_prompt_constructor_function",
|
name: "update_prompt_constructor_function",
|
||||||
},
|
},
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "deriveNewConstructFn",
|
||||||
|
model_translation: (!!newModel).toString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const argString = completion.choices[0]?.message?.function_call?.arguments || "{}";
|
const argString = completion.choices[0]?.message?.function_call?.arguments || "{}";
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,11 @@ export const runGpt4Eval = async (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
openpipe: {
|
||||||
|
tags: {
|
||||||
|
prompt_id: "runOneEval",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user