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

[Question]: stream模式下后端如何获取大模型返回的内容 #45

Closed
2 tasks done
PixMan7 opened this issue Feb 25, 2025 · 1 comment
Closed
2 tasks done
Labels
invalid This doesn't seem right question Further information is requested

Comments

@PixMan7
Copy link

PixMan7 commented Feb 25, 2025

您的问题

类似chat聊天功能,用户发起一段文本,deepseek4j调用大模型返回的内容返回(Stream模式),大模型的返回内容要保存到数据库。咨询下去该如何获取大模型的返回呢?

版本信息

1.4.3

补充信息

// sse 流式返回
@GetMapping(value = "/chat", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<ChatCompletionResponse> chat(String prompt) {
    return deepSeekClient.chatFluxCompletion(prompt);
}

提问前确认

  • 我已经搜索过现有的 issues,但没有找到答案
  • 我已经阅读过文档
@PixMan7 PixMan7 added the question Further information is requested label Feb 25, 2025
@github-actions github-actions bot added the invalid This doesn't seem right label Feb 25, 2025
@VirtualWorlds0813
Copy link

Image

@lltx lltx closed this as completed Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants