Class SpringAIDashscopeService

java.lang.Object
com.bytedesk.ai.springai.service.BaseSpringAIService
com.bytedesk.ai.springai.providers.dashscope.SpringAIDashscopeService
All Implemented Interfaces:
SpringAIService

@Service public class SpringAIDashscopeService extends BaseSpringAIService
  • Field Details

  • Constructor Details

    • SpringAIDashscopeService

      public SpringAIDashscopeService()
  • Method Details

    • createDashscopeOptions

      private com.alibaba.cloud.ai.dashscope.chat.DashScopeChatOptions createDashscopeOptions(RobotLlm llm)
      根据机器人配置创建动态的DashScopeChatOptions
      Parameters:
      llm - 机器人LLM配置
      Returns:
      根据机器人配置创建的选项
    • createDashscopeApi

      public com.alibaba.cloud.ai.dashscope.api.DashScopeApi createDashscopeApi(String apiUrl, String apiKey)
    • createDashscopeChatModel

      private com.alibaba.cloud.ai.dashscope.chat.DashScopeChatModel createDashscopeChatModel(RobotLlm llm)
      根据机器人配置创建动态的DashScopeChatModel
      Parameters:
      llm - 机器人LLM配置
      Returns:
      配置了特定模型的DashScopeChatModel
    • processPromptWebsocket

      protected void processPromptWebsocket(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, String fullPromptContent)
      Description copied from class: BaseSpringAIService
      Token usage data class
      Specified by:
      processPromptWebsocket in class BaseSpringAIService
    • processPromptSync

      protected String processPromptSync(String message, RobotProtobuf robot, String fullPromptContent)
      Specified by:
      processPromptSync in class BaseSpringAIService
    • processPromptSse

      protected void processPromptSse(org.springframework.ai.chat.prompt.Prompt prompt, RobotProtobuf robot, MessageProtobuf messageProtobufQuery, MessageProtobuf messageProtobufReply, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter, String fullPromptContent)
      Specified by:
      processPromptSse in class BaseSpringAIService