-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Producer function can be provided by the LLMConfig to be used fir lazy (
#78) creation instead of providing already created bean. Signed-off-by: Emmanuel Hugonnet <[email protected]>
- Loading branch information
Showing
5 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...core/src/main/java/io/smallrye/llm/core/langchain4j/core/config/spi/ProducerFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package io.smallrye.llm.core.langchain4j.core.config.spi; | ||
|
||
import jakarta.enterprise.inject.Instance; | ||
|
||
/** | ||
* Simple function to produce synthetics beans via BeanData | ||
* | ||
* @param <R> the result. | ||
*/ | ||
@FunctionalInterface | ||
public interface ProducerFunction<R> { | ||
/** | ||
* Produces a bean using its name and a lookup context. | ||
* | ||
* @param lookup: lookup context. | ||
* @param beanName: the name of the bean. | ||
* @return the created bean. | ||
*/ | ||
R produce(Instance<R> lookup, String beanName); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters