类 DeepSeekStreamService

java.lang.Object
top.aoyudi.deepseek.service.DeepSeekStreamService

@Component public class DeepSeekStreamService extends Object
DeepSeek 流服务类 用于处理流式输出
  • 字段详细资料

    • properties

      private final DeepSeekProperties properties
    • restTemplate

      private final org.springframework.web.client.RestTemplate restTemplate
    • logger

      private static final org.slf4j.Logger logger
    • deepSeekConfig

      @Autowired private DeepSeekConfig deepSeekConfig
  • 构造器详细资料

    • DeepSeekStreamService

      public DeepSeekStreamService(DeepSeekProperties properties)
      构造函数,初始化 DeepSeekProperties 和 RestTemplate
      参数:
      properties - DeepSeek 配置属性
  • 方法详细资料

    • sendMessageWithStream

      public reactor.core.publisher.Flux<DSResponse> sendMessageWithStream(DeepSeekRequest request)
      发送消息到 DeepSeek API,并返回响应
      参数:
      request - DeepSeek 请求对象
      返回:
      Flux<top.aoyudi.deepseek.entity.response.DSResponse> 回复体解析
    • parseLineToDSResponse

      private DSResponse parseLineToDSResponse(String line)
      解析每一行数据为 DSResponse 对象
    • jsonProcessor

      private String jsonProcessor(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
      抛出:
      com.fasterxml.jackson.core.JsonProcessingException