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

sse不太好用的感觉啊 #218

Open
zhuangjiaju opened this issue Jan 17, 2025 · 0 comments
Open

sse不太好用的感觉啊 #218

zhuangjiaju opened this issue Jan 17, 2025 · 0 comments

Comments

@zhuangjiaju
Copy link

zhuangjiaju commented Jan 17, 2025

举例:

Image

forest:

     .addOnEvent((eventSource, name, value) -> {
            log.info("name: " + name + ", value: " + value);
            log.info("eventSource: " + eventSource.response().getContent());
        })
        .addOnData((eventSource, name, value) -> {
            log.info("name: " + name + ", value: " + value);
            log.info("eventSource: " + eventSource.response().getContent());
        })

在 event data 分开返回的 我要自己一个个判断数据 我没法把 chat 和 reference的内容分开

okhttp:
public void onEvent(@NotNull EventSource eventSource, String id, String type, @NotNull String data) {

okhttp 只要根据type 我就能区分 是 chat 还是 reference

我期望2条数据给我的时候是一条

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

1 participant