package com.easyagents.llm.ollama;

import com.easyagents.core.model.chat.ChatConfig;
import com.easyagents.core.model.chat.ChatOptions;
import com.easyagents.core.model.client.OpenAIChatRequestSpecBuilder;
import com.easyagents.core.prompt.Prompt;
import com.easyagents.core.util.Maps;

public class OllamaRequestSpecBuilder extends OpenAIChatRequestSpecBuilder {
    protected Maps buildBaseParamsOfRequestBody(Prompt prompt, ChatOptions options, ChatConfig config) {
        Maps params = super.buildBaseParamsOfRequestBody(prompt, options, config);
        params.setIf(!options.isStreaming(), "stream", false);

        // 支持思考
        if (config.isSupportThinking()) {
            params.setIf(options.getThinkingEnabled() != null, "thinking", options.getThinkingEnabled());
        }

        return params;
    }
}
