class Output {
        private String text;
        private String stop_reason;
    }

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

    @Override
    public FinishReason getFinishReason() {<FILL_FUNCTION_BODY>

        String stop_reason = outputs.get(0).stop_reason;
        switch (stop_reason) {
            case "stop":
                return FinishReason.STOP;
            case "length":
                return FinishReason.LENGTH;
            default:
                throw new IllegalArgumentException("Unknown stop reason: " + stop_reason);
        }
    
<no_super_class>