I am making an chat completions call to
Together AIimport Portkey from "portkey-ai";
let portkey = new Portkey({
apiKey: process.env.PORTKEYAI_API_KEY,
virtualKey: process.env.TOGETHERAI_API_KEY,
});
try {
var response = await portkey.chat.completions.create({
messages,
model: "togethercomputer/llama-2-70b-chat",
});
console.info("Success", response);
} catch (error) {
console.error("We saw errors getting response from LLM", error);
}
and I see this error:
error: Either x-portkey-config or x-portkey-provider header is required
at new APIError (/Users/saifas/PKey/cookbook/scripts/node_modules/portkey-ai/dist/src/error.js:7:8)
at new BadRequestError (/Users/saifas/PKey/cookbook/scripts/node_modules/portkey-ai/dist/src/error.js:78:8)
at generate (/Users/saifas/PKey/cookbook/scripts/node_modules/portkey-ai/dist/src/error.js:25:19)
at /Users/saifas/PKey/cookbook/scripts/node_modules/portkey-ai/dist/src/baseClient.js:118:22
at fulfilled (/Users/saifas/PKey/cookbook/scripts/node_modules/portkey-ai/dist/src/baseClient.js:5:47)
I don't usually see this error when making API calls to OpenAI. Should we add config or provider explicitly?