-
Notifications
You must be signed in to change notification settings - Fork 33
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
refactor: use config classes instead of input arguments #7
Comments
don't you think this way is more explicit and easier to read? |
I think it depends on the number and nature of arguments. If we have more than say 5-6 then a dataclass is justified, below that - its easier the way you have it. |
I agree to some extent, however, if you make it into a dataclass or a |
llmflows/llmflows/llms/openai.py
Lines 38 to 42 in 6ce79a8
In such cases, I would appreciate having a
dataclass
,pydantic.BaseModel
, orprotocol
likeOpenAIConfig
so that I avoid having tons of input arguments for class initialisation. Furthermore, you can also fully validate the configs and catch input errors early in your code.The text was updated successfully, but these errors were encountered: