Administrator
2025-09-01 22a3879dcb502e34b287675a2dac27dded499371
src/main/java/cc/mrbird/febs/ai/strategy/Impl/HsLlmStrategyServiceImpl.java
@@ -33,7 +33,14 @@
    private ArkService service;
    private static final String ak = "AKLTZTQxZjMyZTUxMWJmNDEyNDkzNWExOGQ3ODllNzhhNmQ";
    private static final String sk = "TmpFeE1qZ3haREExTW1JeE5HRTBZVGc1WlRRNVlqWXpORGd5TWpsak5HWQ==";
    private static final String baseUrl = "https://ark.cn-beijing.volces.com/api/v3";
    private static final String LinkId = "ep-20250805124033-lhxbf";
    private static final Double temperature = 0.7;
    private static final Double topP = 0.9;
    private static final Integer maxTokens = 2048;
    private static final Double frequencyPenalty = 0.0;
    @PostConstruct
    public void init() {
@@ -47,9 +54,9 @@
        this.service = ArkService.builder()
                .dispatcher(dispatcher)
                .connectionPool(connectionPool)
                .baseUrl("https://ark.cn-beijing.volces.com/api/v3")
                .ak("AKLTZTQxZjMyZTUxMWJmNDEyNDkzNWExOGQ3ODllNzhhNmQ")
                .sk("TmpFeE1qZ3haREExTW1JeE5HRTBZVGc1WlRRNVlqWXpORGd5TWpsak5HWQ")
                .baseUrl(baseUrl)
                .ak(ak)
                .sk(sk)
                .build();
    }
@@ -96,10 +103,10 @@
                    .model(LinkId)
                    .messages(messages)
                    .stream(false)
                    .temperature(0.7) // 降低温度参数,提高确定性,可能提升速度
                    .topP(0.9)        // 调整topP参数
                    .maxTokens(2048)  // 减少最大token数
                    .frequencyPenalty(0.0)
                    .temperature(temperature) // 降低温度参数,提高确定性,可能提升速度
                    .topP(topP)        // 调整topP参数
                    .maxTokens(maxTokens)  // 减少最大token数
                    .frequencyPenalty(frequencyPenalty)
                    .build();
            List<ChatCompletionChoice> choices = service.createChatCompletion(chatCompletionRequest).getChoices();
@@ -126,10 +133,10 @@
                .messages(messages)
                .stream(true)
                .thinking(new ChatCompletionRequest.ChatCompletionRequestThinking("enabled"))
                .temperature(0.7)
                .topP(0.9)
                .maxTokens(2048)
                .frequencyPenalty(0.0)
                .temperature(temperature) // 降低温度参数,提高确定性,可能提升速度
                .topP(topP)        // 调整topP参数
                .maxTokens(maxTokens)  // 减少最大token数
                .frequencyPenalty(frequencyPenalty)
                .build();
        return Flux.from(service.streamChatCompletion(chatCompletionRequest))