c7c4ee8eab
This is a small prototype based on discussions originating from https://github.com/ai-for-java/openai4j/pull/13 The approach I took here is to allow for decorating the models/builders with additional functionality without having to extend model classes or builders. I did it for a single model in this prototype - the `OpenAiChatModel`, but this pattern could be applied to all of the other models across Langchain4J. That doesn't mean you couldn't extend the model classes if you wanted to use inheritance. I just try to avoid it and use composition instead. I also added a test which shows how it would be used. Downstream libraries (like Spring Boot or Quarkus) could use this mechanism to extend/enhance with their own capabilities which aren't necessarily part of the model. Let me know what you think @geoand / @langchain4j ! Happy to continue conversation and see where we can bring this! |
||
---|---|---|
.. | ||
src | ||
pom.xml |