HamaWhiteGG / langchain-java

Java version of LangChain, while empowering LLM for Big Data.
Apache License 2.0
545 stars 106 forks source link

Stream is not work. #131

Open Lester-Tai opened 10 months ago

Lester-Tai commented 10 months ago

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

HamaWhiteGG commented 9 months ago

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();
    }
}
Lester-Tai commented 9 months ago

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

HamaWhiteGG commented 9 months ago

Yes, I will