Skip to content

Commit 7ea87dc

Browse files
committed
update build config logic for ollama by removing advance setting default for format field
1 parent 833d78d commit 7ea87dc

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

src/lfx/src/lfx/_assets/component_index.json

Lines changed: 1 addition & 5 deletions
Large diffs are not rendered by default.

src/lfx/src/lfx/components/ollama/ollama.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ class ChatOllamaComponent(LCModelComponent):
123123
name="format",
124124
display_name="Format",
125125
info="Specify the format of the output.",
126-
advanced=False,
127126
table_schema=TABLE_SCHEMA,
128127
value=default_table_row,
129128
show=False,
@@ -222,7 +221,7 @@ class ChatOllamaComponent(LCModelComponent):
222221
display_name="Enable Structured Output",
223222
info="Whether to enable structured output in the model.",
224223
value=False,
225-
advanced=True,
224+
advanced=False,
226225
real_time_refresh=True,
227226
),
228227
*LCModelComponent.get_base_inputs(),
@@ -329,12 +328,8 @@ async def is_valid_ollama_url(self, url: str) -> bool:
329328
return False
330329

331330
async def update_build_config(self, build_config: dict, field_value: Any, field_name: str | None = None):
332-
if field_name == "enable_structured_output":
333-
if field_value:
334-
build_config["format"]["show"] = True
335-
else:
336-
build_config["format"]["show"] = False
337-
return build_config
331+
if field_name == "enable_structured_output": # bind enable_structured_output boolean to format show value
332+
build_config["format"]["show"] = field_value
338333

339334
if field_name == "mirostat":
340335
if field_value == "Disabled":

0 commit comments

Comments
 (0)