File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/java/src/main/java/ai/onnxruntime/genai Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22
22
* </ul>
23
23
*
24
24
* <p>The listener is used as a callback mechanism so that tokens can be used as they are generated.
25
- * Create a class that implements the TokenUpdateListener interface and provide an instance of that
26
- * class as the `listener` argument.
25
+ * It should be an instance of a type that implements the Consumer<String> interface.
27
26
*/
28
27
public class SimpleGenAI implements AutoCloseable {
29
28
private Model model ;
@@ -60,7 +59,9 @@ public GeneratorParams createGeneratorParams() throws GenAIException {
60
59
* @param generatorParams The prompt and settings to run the model with.
61
60
* @param prompt The prompt text to encode.
62
61
* @param listener Optional callback for tokens to be provided as they are generated. NOTE: Token
63
- * generation will be blocked until the listener's `accept` method returns.
62
+ * generation will be blocked until the listener's `accept` method returns. `listener` will be
63
+ * called within the token generation loop and these calls will be made sequentially, not
64
+ * concurrently.
64
65
* @return The generated text.
65
66
* @throws GenAIException on failure
66
67
*/
You can’t perform that action at this time.
0 commit comments