ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
14.52k stars 1.4k forks source link

Could add support for Azure OpenAI or custom API endpoint? #11

Closed aiyogg closed 6 months ago

aiyogg commented 6 months ago

Is your feature request related to a problem? Please describe. Some people only have Azure OpenAI do not have offical api.

Describe the solution you'd like Add enviorment variables or setting UI to support the Azure API or custom endpoint.

Describe alternatives you've considered Provide a page with form that can custom the API type may be a cool solution.

Additional context And I see the OPENAI_API_KEY env defiened in .env file, but don't use in anywhere, it's a mistake or it used with another way?

Thank you for your dedication and effort.

ItzCrazyKns commented 6 months ago

Hey, you just need to pass them as an environment variable in the env file and OpenAI package would automatically read it from the env file. Yes, I am changing how settings work and the UI will be released pretty soon.

ItzCrazyKns commented 6 months ago

Just replace OPENAI_API_KEY in the env file with these variables and fill them. Then delete the previous images (from Docker) and rebuild the images.

AZURE_OPENAI_API_ENDPOINT=<YOUR_ENDPOINT>
AZURE_OPENAI_API_KEY=<YOUR_KEY>
AZURE_OPENAI_API_DEPLOYMENT_NAME=<YOUR_DEPLOYMENT_NAME>
xeniode commented 4 months ago

Did you mean put this in config.toml?

ItzCrazyKns commented 4 months ago

Did you mean put this in config.toml?

You need to choose the custom OpenAI provider in the settings menu (from the UI) after which you'll be able to fill the details there. This is an old issue.