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,
},