class Completion {
        private Prompt data;
        private CompletionReason finishReason;
    }

    private int id;
    private Prompt prompt;
    private List<Completion> completions;

    @Override
    public String getOutputText() {
        return completions.get(0).data.text;
    }

    @Override
    public FinishReason getFinishReason() {<FILL_FUNCTION_BODY>

        final String finishReason = completions.get(0).getFinishReason().getReason();
        switch (finishReason) {
            case "endoftext":
                return FinishReason.STOP;
            default:
                throw new IllegalStateException("Unknown finish reason: " + finishReason);
        }
    
<no_super_class>