Class SpringAIDashscopeService
java.lang.Object
com.bytedesk.ai.springai.base.BaseSpringAIService
com.bytedesk.ai.springai.dashscope.SpringAIDashscopeService
- All Implemented Interfaces:
SpringAIService
@Service
@ConditionalOnProperty(name="spring.ai.dashscope.chat.enabled",
havingValue="true",
matchIfMissing=false)
public class SpringAIDashscopeService
extends BaseSpringAIService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final io.micrometer.core.instrument.Counter
private final io.micrometer.core.instrument.Timer
private final org.springframework.ai.chat.client.ChatClient
Fields inherited from class com.bytedesk.ai.springai.base.BaseSpringAIService
messagePersistCache, messageSendService, robotRestService, springAIVectorService, threadRestService, uidUtils
-
Constructor Summary
ConstructorsConstructorDescriptionSpringAIDashscopeService
(org.springframework.ai.chat.client.ChatClient bytedeskDashScopeChatClient, Optional<SpringAIVectorService> springAIVectorService, IMessageSendService messageSendService, io.micrometer.core.instrument.MeterRegistry registry, UidUtils uidUtils, RobotRestService robotRestService, ThreadRestService threadRestService, MessagePersistCache messagePersistCache) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
generateFaqPairs
(String prompt) protected void
processPrompt
(org.springframework.ai.chat.prompt.Prompt prompt, MessageProtobuf messageProtobuf) protected void
processPromptSSE
(org.springframework.ai.chat.prompt.Prompt prompt, MessageProtobuf messageProtobuf, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) protected String
processPromptSync
(String message) Methods inherited from class com.bytedesk.ai.springai.base.BaseSpringAIService
buildKbPrompt, generateFaqPairsAsync, generateFaqPairsSync, persistMessage, sendSseMessage, sendWebsocketMessage
-
Field Details
-
bytedeskDashScopeChatClient
@Qualifier("bytedeskDashScopeChatClient") private final org.springframework.ai.chat.client.ChatClient bytedeskDashScopeChatClient -
aiRequestCounter
private final io.micrometer.core.instrument.Counter aiRequestCounter -
aiResponseTimer
private final io.micrometer.core.instrument.Timer aiResponseTimer
-
-
Constructor Details
-
SpringAIDashscopeService
public SpringAIDashscopeService(@Qualifier("bytedeskDashScopeChatClient") org.springframework.ai.chat.client.ChatClient bytedeskDashScopeChatClient, Optional<SpringAIVectorService> springAIVectorService, IMessageSendService messageSendService, io.micrometer.core.instrument.MeterRegistry registry, UidUtils uidUtils, RobotRestService robotRestService, ThreadRestService threadRestService, MessagePersistCache messagePersistCache)
-
-
Method Details
-
processPrompt
protected void processPrompt(org.springframework.ai.chat.prompt.Prompt prompt, MessageProtobuf messageProtobuf) - Specified by:
processPrompt
in classBaseSpringAIService
-
generateFaqPairs
- Specified by:
generateFaqPairs
in classBaseSpringAIService
-
processPromptSync
- Specified by:
processPromptSync
in classBaseSpringAIService
-
processPromptSSE
protected void processPromptSSE(org.springframework.ai.chat.prompt.Prompt prompt, MessageProtobuf messageProtobuf, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) - Specified by:
processPromptSSE
in classBaseSpringAIService
-