Package chat.octet.model
Class Generator
java.lang.Object
chat.octet.model.Generator
Generation iterator,
which outputs tokens one by one in a stream format.
- Author:
- William
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGenerator(GenerateParameter generateParams, String text) Create regular generatorprotectedGenerator(GenerateParameter generateParams, String prompt, Status srcStatus) Create continuous conversation generator -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
Generator
Create continuous conversation generator- Parameters:
generateParams- Specify a generation parameter.prompt- PromptsrcStatus- Source status.
-
Generator
Create regular generator- Parameters:
generateParams- Specify a generation parameter.text- Input text or prompt.
-
-
Method Details
-
getStatus
-
hasNext
public boolean hasNext() -
next
Output next token. -
getGeneratedCompleteText
Return the generated complete text.- Returns:
- String
-
getFinishReason
Return the finished reason for the last token.- Returns:
- FinishReason, Last token finished reason.
- See Also:
-
clearCache
public void clearCache()Clear context cache at the end of generation
-