magentic icon indicating copy to clipboard operation
magentic copied to clipboard

Supporting additional parameters of OpenAI client in OpenaiChatModel

Open piiq opened this issue 10 months ago • 1 comments

The openai client allows setting a bunch of parameters that are helpful when I'm working on very specific things.

For example timeout is very helpful when processing a very big batch.

Image

Would it be possible/make sense to allow passing kwargs when instantiating the OpenaiChatModel to channel those into the openai client?

Image

What are your thoughts on this?

piiq avatar Apr 17 '25 08:04 piiq

@piiq I'd prefer to add all the settings individually (rather than kwargs) because some settings are set by magentic so shouldn't be supplied by users, and it's nice to have type annotation / autocompletion support from static/defined params. Would definitely accept a PR to add the timeout param and any others you find useful!

jackmpcollins avatar Apr 29 '25 05:04 jackmpcollins

For me this was addressed my the merge of the OpenRouterChatModel, in https://github.com/jackmpcollins/magentic/pull/448 so I'll close this issue.

piiq avatar Sep 09 '25 11:09 piiq