Exactly. A function for each type of output and an abstraction that is being “called” in the main logic. This way you close the code for modification, but it is open for extension, because you can easily add a new output function, without modifying the existing logic.
Exactly. A function for each type of output and an abstraction that is being “called” in the main logic. This way you close the code for modification, but it is open for extension, because you can easily add a new output function, without modifying the existing logic.
Exactly. A function for each type of output and an abstraction that is being “called” in the main logic. This way you close the code for modification, but it is open for extension, because you can easily add a new output function, without modifying the existing logic.
Yes!
Do you mean having e.g. formatter_text(), formatter_json() and passing those as arguments to the call_llm() function instead of the enum?
Or do you mean having completely separate functions like call_llm_as_text(), call_llm_as_json() ?