Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

hide temperature, top p and top k, when `Use Reasoning` is selected

Forhad Hosain9d634bd971a5
diff --git a/packages/app/src/builder-ui/components/GenAILLM.class.ts b/packages/app/src/builder-ui/components/GenAILLM.class.ts
index c6e115be..c75abfe4 100644
--- a/packages/app/src/builder-ui/components/GenAILLM.class.ts
+++ b/packages/app/src/builder-ui/components/GenAILLM.class.ts
@@ -1575,6 +1575,18 @@ export class GenAILLM extends Component {
// Handle other nested fields (maxThinkingTokens) with the standard toggle logic
this.toggleNestedFields(parentField, form, fieldsToShow);
+
+ // Anthropic API does not support temperature, top_p, or top_k when extended thinking is enabled.
+ // Hide these fields when reasoning is checked for Anthropic thinking models.
+ if (this.anthropicThinkingModels.includes(currentModel)) {
+ const samplingFields = ['temperature', 'topP', 'topK'];
+ samplingFields.forEach((fieldName) => {
+ const fieldElm = form?.querySelector(`[data-field-name="${fieldName}"]`) as HTMLElement;
+ if (fieldElm) {
+ fieldElm.classList.toggle('hidden', parentField.checked);
+ }
+ });
+ }
}
/**