actually fixes prompt logger path detection

This commit is contained in:
nai-degen 2023-04-14 20:54:55 -07:00
parent 717788b9b0
commit 673f6f6185
1 changed files with 6 additions and 1 deletions

View File

@ -18,8 +18,13 @@ export const logPrompt: ProxyResHandlerWithBody = async (
throw new Error("Expected body to be an object");
}
// Only log prompts if we're making a request to a completion endpoint
if (!req.originalUrl.endsWith(COMPLETE_ENDPOINT)) {
if (!req.path.startsWith(COMPLETE_ENDPOINT)) {
// Remove this once we're confident that we're not missing any prompts
req.log.info(
`Not logging prompt for ${req.path} because it's not a completion endpoint`
);
return;
}