-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep defaults? #2
base: main
Are you sure you want to change the base?
Conversation
BTW, it may also make sense to remove defaults for models parameter, instead of #1. |
I don't think there was a particular reason, probably just left over when testing. |
@@ -366,7 +364,6 @@ class OpenAI | |||
cjson.encode payload | |||
|
|||
headers = { | |||
"Host": parse_url(@api_base).host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host header is part of HTTP spec, not related to any of the APIs. As this library tries to support many environments/clients, in my experience I've had some issues with Lua http clients not correctly setting host header based on the request URL. For that reason I would not remove it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly, in my humble opinion, it appears that we are trying to solve a problem that does not yet exist.
Having tested the LuaSocket with numerous different services without explicitly setting the Host in the library code, I didn’t encounter any problems. Of course, there is always the possibility someone, someday, might encounter an issue in a different environment.
In such an event, we would still have three options:
- Request a proper fix in the appropriate location (i.e. the custom Lua HTTP client).
- Instead of waiting for it to be fixed, set the header in the user code with solution Support additional headers #4.
- As a last resort, we can always modify the Lua-OpenAI code itself, preferably not prematurely.
However, the final decision is ultimately up to you and I will withdraw the last commit if you insist.
The models come and go, it is the client's responsibility to stay updated. P.S. We could ensure that the model is specified, but what's the point? The server returns an error without needing assistance from the library."
Ref: - https://platform.openai.com/docs/api-reference/making-requests Instead, we should implement the ability to include arbitrary headers
This is rather a question.
Is there a reason to unconditionally alter openai defaults?