Skip to content

Commit dc448b5

Browse files
authored
Update SimpleGenAI.java docs (microsoft#1532)
1 parent 7c02fe6 commit dc448b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/java/src/main/java/ai/onnxruntime/genai/SimpleGenAI.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
* </ul>
2323
*
2424
* <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&lt;String&gt; interface.
2726
*/
2827
public class SimpleGenAI implements AutoCloseable {
2928
private Model model;
@@ -60,7 +59,9 @@ public GeneratorParams createGeneratorParams() throws GenAIException {
6059
* @param generatorParams The prompt and settings to run the model with.
6160
* @param prompt The prompt text to encode.
6261
* @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.
6465
* @return The generated text.
6566
* @throws GenAIException on failure
6667
*/

0 commit comments

Comments
 (0)