mkht / PSOpenAI

PowerShell module for OpenAI API.
MIT License
25 stars 7 forks source link

Surfacing Invoke-OpenAIAPIRequest, extending Get-OpenAIAPIEndpoint #25

Open potatoqualitee opened 1 week ago

potatoqualitee commented 1 week ago

Right now, I have to dot source all of your internal files to get access to Invoke-OpenAIAPIRequest as I need to make calls that your module does not currently support.

https://github.com/potatoqualitee/finetuna/blob/main/finetuna.psm1#L8

Of course that also means that I had to add extra endpoints to Get-OpenAIAPIEndpoint so would there be a way to extend that by an end-user?

Alternatively, we could add every endpoint based on OpenAPI Schema.

mkht commented 1 week ago

At least at this time users can't register arbitrary endpoints; I suppose we could add Invoke-OpenAIAPIRequest or a new function that thinly wraps it and expose it, but how valuable would it be?

It would be a bit difficult to dynamically load OpenAI's OpenAPI schema. It is often broken.

potatoqualitee commented 1 week ago

ive appreciated being able to execute new features before they are released or supported officially in other modules and expose that functionality for my own users when it makes sense. in this case, i had to do big workarounds.

Perhaps there could be an $EndpointArgumentList hashtable param that can help bypass the Get-OpenAIAPIEndpoint requirement? that sounds powershelly

I wondered about the schema being broken! They update it a lot but I haven't found it very reliable. Thanks for the confirmation.