Package edu.tufts.hrilab.llm
Class Completion
java.lang.Object
edu.tufts.hrilab.llm.Completion
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompletion
(LlamaCompletionResponse response) Completion
(OpenaiChatCompletionResponse response) Completion
(OpenaiCompletionResponse response) -
Method Summary
-
Field Details
-
text
-
id
-
created
public long created -
service
-
model
-
type
-
inputTokens
public int inputTokens -
outputTokens
public int outputTokens
-
-
Constructor Details
-
Completion
-
Completion
-
Completion
-
-
Method Details
-
getText
-
toString
-
getId
-
getModel
-
getService
-
getType
-
getCreated
public long getCreated() -
getInputTokens
public int getInputTokens() -
getOutputTokens
public int getOutputTokens() -
getCode
-
hasCode
public boolean hasCode() -
extractCodeFromText
Returns a string array of code blocks within a string that are contained within markdown triple tick blocks.- Parameters:
text
- Response text to extract code from- Returns:
- Array of code strings
-