microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.07k stars 6.43k forks source link

proxy settings for AI #33037

Open BessonovVyacheslav1 opened 3 months ago

BessonovVyacheslav1 commented 3 months ago

Description of the new feature / enhancement

Hello, can you please make work via proxy or vpn in "Advanced Paste" parameters, because OpenAI is the most open and free that closed access from some countries. I have an api key and can buy the pro version. Even in JavaGPT there is a proxy related parameter

Scenario when this would be used?

Menu where you can use proxy only for OpenAI requests. In short, don't force to enable system vpn for the sake of just one function

Supporting information

https://platform.openai.com/docs/supported-countries Unfortunately the country I live in is not on the list, but I use daily using proxy or vpn on different devices AdvancedPasteAInotWork

htcfreek commented 3 months ago

@jaimecbernardo Bug or Enhancement?

jaimecbernardo commented 3 months ago

Enhancement, I believe

AlexDe-v commented 3 months ago

I've also wanted something like this, I ended up modifying the source code to make it work with a free API :D

lurebat commented 3 months ago

+1 - right now there is no way to use Microsoft's Azure Open AI with Microsoft's powertoys.

Also, the model is hardcoded to gpt3.5-turbo-instruct, this should probably be configurable too

joadoumie commented 3 months ago

I'm not yet familiar with the intricacies of this -- is this related to https://github.com/microsoft/PowerToys/issues/33068

lurebat commented 3 months ago

Nothing like this.

Basically there are currently two hardcoded parameters that we want to make configurable:

  1. The endpoint - there is a another ctor for the class that accepts a URI for an endpoint - https://learn.microsoft.com/en-us/dotnet/api/azure.ai.openai.openaiclient.-ctor?view=azure-dotnet-preview#azure-ai-openai-openaiclient-ctor(system-string)

  2. The model - currently it's hardcoded to be "gpt-3.5-turbo-instruct", but that might not be available for all users in all proxies.

It's used for proxies for people who can't access the original url for any reason, and for other llms that expose a compatible API with openai.