RageAgainstThePixel / OpenAI-DotNet

A Non-Official OpenAI RESTful API Client for DotNet
https://openai.com
MIT License
696 stars 149 forks source link

Question about DefaultRequestHeaders #198

Closed fejdraus closed 11 months ago

fejdraus commented 11 months ago

Class "OpenAIClient".

Why is "client.DefaultRequestHeaders.Add("OpenAI-Beta", "assistants=v1");" always used? Because it is not needed for all requests, it is needed, for example, for assistants requests, but it is not needed for working with files.

Why is "OpenAI-DotNet" written in client.DefaultRequestHeaders.Add("User-Agent", "OpenAI-DotNet"); ? Maybe it would be better to make an optional fill?

StephenHodgson commented 11 months ago

I think that's a great question, but I did not implement that part. I think it was only used to get the new beta endpoints working correctly.

Does it really matter that there's extra headers?

fejdraus commented 11 months ago

It turns out that we always request Beta version of API, even when there is a stable one. Perhaps because of this the unstable End-point will always be used, even if there is already a stable version.

StephenHodgson commented 11 months ago

I think the existing API endpoints are probably fine.

Besides I did have to make modifications to support the updated end points anyway.

StephenHodgson commented 11 months ago

If it turns out being more of a problem we can come back to this. But for now I'd rather leave it the way it is

fejdraus commented 11 months ago

"Does it really matter that there's extra headers?" - It'd be great if you could change them.

StephenHodgson commented 11 months ago

I will consider it if it becomes a problem

fejdraus commented 11 months ago

All right. Thank you.