langchain-java icon indicating copy to clipboard operation
langchain-java copied to clipboard

Stream is not work.

Open Lester-Tai opened this issue 2 years ago • 3 comments

Hello, i enable the stream and it's not work. And i can't find the implementation of callback. Are you conduct it?

Lester-Tai avatar Nov 23 '23 07:11 Lester-Tai

Supports Stream, but there is no callback.

see StreamOpenAIExample

public class StreamOpenAIExample {

    public static void main(String[] args) {

        var llm = OpenAI.builder()
                .maxTokens(1000)
                .temperature(0)
                .requestTimeout(120)
                .build()
                .init();

        var result = llm.asyncPredict("Introduce West Lake in Hangzhou, China.");
        result.doOnNext(System.out::print).blockLast();
    }
}

HamaWhiteGG avatar Nov 30 '23 02:11 HamaWhiteGG

All right, thx for your response. Will you implement the callback in the future?

Lester-Tai avatar Dec 04 '23 07:12 Lester-Tai

Yes, I will

HamaWhiteGG avatar Dec 04 '23 09:12 HamaWhiteGG