Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以流式输出吗,直接等待完成太长时间了? #104

Closed
mumengmeng opened this issue Sep 17, 2023 · 2 comments
Closed

可以流式输出吗,直接等待完成太长时间了? #104

mumengmeng opened this issue Sep 17, 2023 · 2 comments

Comments

@mumengmeng
Copy link

可以流式输出吗,直接等待完成太长时间了?

@HamaWhiteGG
Copy link
Owner

supported, see StreamOpenAIExample

@RunnableExample
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();
    }
}

@mumengmeng
Copy link
Author

niubility!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants