Closed potatoqualitee closed 5 months ago
Deployment (or model) is not a common parameter and does not seem appropriate to include in Context. Is there any reason why PSDefaultParameterValues should not?
$azparms = @{
ApiType = 'azure'
ApiKey = 'xyz'
ApiBase = 'https://xyz.openai.azure.com'
Deployment = 'gpt4'
}
Set-OpenAIContext @azparms
Request-ChatCompletion -Message 'Hello Azure OpenAI'
# ERROR
Request-Embeddings -Text 'Hello Azure OpenAI'
I'm trying to avoid having users do two things to use Azure. Currently I have to tell them
Step 1. Set your PSDefaultParameterValues Step 2. Run this context command
Feels like there's an opportunity to make it more streamlined. I'm actually having an issue running Request-Embeddings even on main. I keep getting a 404 and the URL is
https://XYZ.openai.azure.com//openai/deployments/text-embedding-ada-002/embeddings
?api-version=2024-05-01-preview
Actually, I can't get Request-ChatCompletion to work either, per https://github.com/mkht/PSOpenAI/blob/main/Guides/How_to_use_with_Azure_OpenAI_Service.ipynb
I tried from the gallery as well and I'm getting Deployment not a param 🤔
btw, if you're opposed, i just saw on my other module that I made wrapper commands to make Azure auth more streamlined in PSAI. I can do that in my modules as well. That may actually work better since I can set PSDefaultParameterValues there.
Sorry for the late reply. I was busy with my main job and didn't have much time.
I'm not totally against it, and I understand that it is not smart to have to use context and PSDefaultParameterValues together. But I just don't think it is a very good design to add a model name to a common context that changes depending on the function that calls it. I would like to consider if there is a better design.
no problem, im busy until the end of june too 💀
im thinking that the way to solve it for both of us is that it's not required. if they pass it, we set it and if they don't then they can do the two-parter as they wish, if that makes sense.
I'll open this once again if it works out
This makes it easier to do
Instead of a mix of $DeploymentName and Set-OpenAIContext.