All checks were successful
Forgejo Android APK / Build signed APK (push) Successful in 1m53s
20 lines
863 B
JavaScript
20 lines
863 B
JavaScript
function resolveGenerationOptions(options) {
|
|
options = options || {};
|
|
return {
|
|
temperature: options.temperature ?? 0.3,
|
|
maxTokens: options.maxTokens ?? 4000,
|
|
reasoningEffort: options.reasoningEffort,
|
|
reasoningFormat: options.reasoningFormat
|
|
};
|
|
}
|
|
|
|
function addReasoningOptions(request, generation) {
|
|
// These OpenAI-compatible fields are rejected by ordinary chat models such as GPT-4.1.
|
|
// Keep the Clinical Assistant profile, but only send it to the Groq Qwen model that supports both fields.
|
|
if (request.model !== 'groq-qwen3.8-27b') return request;
|
|
if (generation.reasoningEffort != null) request.reasoning_effort = generation.reasoningEffort;
|
|
if (generation.reasoningFormat != null) request.reasoning_format = generation.reasoningFormat;
|
|
return request;
|
|
}
|
|
|
|
module.exports = { resolveGenerationOptions, addReasoningOptions };
|