Open eplusg opened 7 months ago
Hi, looking at preplexity’s api docs, it seems that they have an openai compatible. This means that hoarder will support it out of the box. Just set ‘OPENAI_BASE_URL=https://api.perplexity.ai’ and you’re probably good to go. I’m interested if this works (to add it to the docs), please give it a try and let me know how it goes :)
I'll close this for now and don't hesitate to reopen if you faced any issues.
Hi, thanks for the awesome hoarding tool. I also have perplexity pro. While I tried this but it was not working. Below is the error I am getting:
2024-10-24T14:32:47.772Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.839Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.890Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.941Z info: [inference][1518] Starting an inference job for bookmark with id "ds63wmjiy5x75v4ejnz7zruw" 2024-10-24T14:32:47.974Z error: [inference][1518] inference job failed: Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"] Error: 400 ["At body -> response_format -> ResponseFormatText -> type: Input should be 'text'", "At body -> response_format -> ResponseFormatJSONSchema -> type: Input should be 'json_schema'", "At body -> response_format -> ResponseFormatJSONSchema -> json_schema: Field required", "At body -> response_format -> ResponseFormatRegex -> type: Input should be 'regex'", "At body -> response_format -> ResponseFormatRegex -> regex: Field required"] at APIError.generate (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/error.js:45:20) at OpenAI.makeStatusError (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:291:33) at OpenAI.makeRequest (/app/apps/workers/node_modules/.pnpm/openai@4.67.1_zod@3.22.4/node_modules/openai/core.js:335:30) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async OpenAIInferenceClient.inferFromText (/app/apps/workers/inference.ts:2:1934) at async inferTagsFromText (/app/apps/workers/openaiWorker.ts:6:3111) at async inferTags (/app/apps/workers/openaiWorker.ts:6:3334) at async Object.runOpenAI [as run] (/app/apps/workers/openaiWorker.ts:6:6764) at async Runner.runOnce (/app/apps/workers/node_modules/.pnpm/@hoarder+queue@file+packages+queue/node_modules/@hoarder/queue/runner.ts:2:2567)
https://www.perplexity.ai/hub/blog/introducing-pplx-api - looks like the example doesn't include response_format
in the request so this would need to be optionally removed from the call if the provider is Perplexity. (P.S. I've having the same issue as @firefoot007)
Hi, Thank you for developing this amazing software.
I am currently using Perplexity PRO, which provides each user with $5 in API credits on a monthy basis. It would be great to use this as an OpenAI API alternative.
Keep up the good work!