"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    autoGlmAdapters: ()=>autoGlmAdapters
});
const external_locate_js_namespaceObject = require("./locate.js");
const external_planning_js_namespaceObject = require("./planning.js");
const external_prompt_js_namespaceObject = require("./prompt.js");
const defaultAutoGlmReplanningCycleLimit = 100;
function createAutoGlmAdapter({ getPlanPrompt, getLocatePrompt }) {
    return {
        chatCompletion: {
            unsupportedUserConfig: [
                'reasoningEnabled',
                'reasoningEffort',
                'reasoningBudget'
            ],
            buildChatCompletionParams: ({ midsceneDefaults, userConfig })=>{
                const commonOverrideConfig = {};
                if (void 0 !== userConfig.temperature) commonOverrideConfig.temperature = userConfig.temperature;
                const modelSpecificConfig = {
                    top_p: 0.85,
                    frequency_penalty: 0.2
                };
                return {
                    config: {
                        ...midsceneDefaults,
                        ...commonOverrideConfig,
                        ...modelSpecificConfig
                    }
                };
            }
        },
        planning: {
            kind: 'custom',
            cacheEnabled: false,
            defaultReplanningCycleLimit: defaultAutoGlmReplanningCycleLimit,
            planFn: (userInstruction, options)=>(0, external_planning_js_namespaceObject.autoGlmPlanning)(userInstruction, options, getPlanPrompt)
        },
        locate: {
            kind: 'custom',
            locateFn: (elementDescription, options)=>(0, external_locate_js_namespaceObject.autoGlmLocate)(elementDescription, options, getLocatePrompt)
        }
    };
}
const autoGlmAdapters = {
    'auto-glm': createAutoGlmAdapter({
        getPlanPrompt: external_prompt_js_namespaceObject.getAutoGLMChinesePlanPrompt,
        getLocatePrompt: external_prompt_js_namespaceObject.getAutoGLMChineseLocatePrompt
    }),
    'auto-glm-multilingual': createAutoGlmAdapter({
        getPlanPrompt: external_prompt_js_namespaceObject.getAutoGLMMultilingualPlanPrompt,
        getLocatePrompt: external_prompt_js_namespaceObject.getAutoGLMMultilingualLocatePrompt
    })
};
exports.autoGlmAdapters = __webpack_exports__.autoGlmAdapters;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "autoGlmAdapters"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});

//# sourceMappingURL=adapter.js.map