class QwenStreamingResponseBuilder {
    private final StringBuilder generatedContent = new StringBuilder();

    private Integer inputTokenCount;

    private Integer outputTokenCount;

    private FinishReason finishReason;

    public QwenStreamingResponseBuilder() {}

    public String append(GenerationResult partialResponse) {
        if (partialResponse == null) {
            return null;
        }

        GenerationUsage usage = partialResponse.getUsage();
        if (usage != null) {
            inputTokenCount = usage.getInputTokens();
            outputTokenCount = usage.getOutputTokens();
        }

        FinishReason finishReason = finishReasonFrom(partialResponse);
        if (finishReason != null) {
            this.finishReason = finishReason;
            if (!hasAnswer(partialResponse)) {
                return null;
            }
        }

        String partialContent = answerFrom(partialResponse);
        generatedContent.append(partialContent);

        return partialContent;
    }

    public String append(MultiModalConversationResult partialResponse) {<FILL_FUNCTION_BODY>}

    public Response<AiMessage> build() {
        return Response.from(
                AiMessage.from(generatedContent.toString()),
                new TokenUsage(inputTokenCount, outputTokenCount),
                finishReason
        );
    }
}

        if (partialResponse == null) {
            return null;
        }

        MultiModalConversationUsage usage = partialResponse.getUsage();
        if (usage != null) {
            inputTokenCount = usage.getInputTokens();
            outputTokenCount = usage.getOutputTokens();
        }

        FinishReason finishReason = finishReasonFrom(partialResponse);
        if (finishReason != null) {
            this.finishReason = finishReason;
            if (!hasAnswer(partialResponse)) {
                return null;
            }
        }

        String partialContent = answerFrom(partialResponse);
        generatedContent.append(partialContent);

        return partialContent;
    
<no_super_class>